rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
string = ":%s [%-7s] %s %s%s"%( | string = ":%s [%-7s]%s %s %s%s"%( | def debugStateCall(self, obj=None, fsmMemberName='fsm'): """ If this notify is in debug mode, print the time of the call followed by the [fsm state] notifier category and the function call (with parameters). """ if (self.__debug): state = '' if obj is not None: if hasattr(obj, fsmMemberName) and obj.fsm.getCurrentState() is not None: #state = "%s=%s"%(obj.fsm.getName(), obj.fsm.getCurrentState().getName()) state = obj.fsm.getCurrentState().getName() if 1 or type(obj) == types.ClassType: name = "%s."%(obj.__class__.__name__,) else: name = "%s "%(self.__name,) string = ":%s [%-7s] %s %s%s"%( self.getOnlyTime(), state, id(obj), name, PythonUtil.traceParentCall()) self.__log(string) self.__print(string) return 1 # to allow assert(myNotify.debug("blah")) | 95256fa6b19058a1bd190e5c1d80bb3a218f2742 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8543/95256fa6b19058a1bd190e5c1d80bb3a218f2742/Notifier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
1119,
1477,
12,
2890,
16,
1081,
33,
7036,
16,
26957,
4419,
461,
2218,
2556,
81,
11,
4672,
3536,
971,
333,
5066,
353,
316,
1198,
1965,
16,
1172,
326,
813,
434,
326,
745,
10860,
63... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1198,
1119,
1477,
12,
2890,
16,
1081,
33,
7036,
16,
26957,
4419,
461,
2218,
2556,
81,
11,
4672,
3536,
971,
333,
5066,
353,
316,
1198,
1965,
16,
1172,
326,
813,
434,
326,
745,
10860,
63... |
t[0] = createList( 'valuelist', t ) | t[0] = createListleft( t ) | def p_valuelist(t): ''' valuelist : value valuelist | value ''' t[0] = createList( 'valuelist', t ) | 1a8e540808c326b13fcc3d7ecf1906c80d3bce53 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/1a8e540808c326b13fcc3d7ecf1906c80d3bce53/emparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
67,
4531,
5449,
12,
88,
4672,
9163,
21748,
5449,
294,
460,
21748,
5449,
571,
460,
9163,
268,
63,
20,
65,
273,
225,
752,
682,
4482,
12,
268,
262,
225,
2,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
293,
67,
4531,
5449,
12,
88,
4672,
9163,
21748,
5449,
294,
460,
21748,
5449,
571,
460,
9163,
268,
63,
20,
65,
273,
225,
752,
682,
4482,
12,
268,
262,
225,
2,
-100,
-100,
-100,
-100,
... |
num2 = sys2; den2 = 2; | num2 = sys2; den2 = 1; | def feedback(sys1, sys2, sign=-1): # Get the numerator and denominator of the first system if (isinstance(sys1, (int, long, float, complex))): num1 = sys1; den1 = 1; elif (isinstance(sys1, TransferFunction)): num1 = sys1.num; den1 = sys1.den; else: raise TypeError | 4e468638ce63a723d35222ecd94c6a1ab1ab5446 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6610/4e468638ce63a723d35222ecd94c6a1ab1ab5446/xferfcn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10762,
12,
9499,
21,
16,
2589,
22,
16,
1573,
29711,
21,
4672,
468,
968,
326,
16730,
471,
15030,
434,
326,
1122,
2619,
309,
261,
291,
1336,
12,
9499,
21,
16,
261,
474,
16,
1525,
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,
10762,
12,
9499,
21,
16,
2589,
22,
16,
1573,
29711,
21,
4672,
468,
968,
326,
16730,
471,
15030,
434,
326,
1122,
2619,
309,
261,
291,
1336,
12,
9499,
21,
16,
261,
474,
16,
1525,
16,
1... |
security.declareProtected(permissions.View, 'copy') | security.declareProtected(CMFCorePermissions.View, 'copy') | def __add__(self, other): c = Schema() # We can't use update and keep the order so we do it manually for field in self.fields(): c.addField(field) for field in other.fields(): c.addField(field) # Need to be smarter when joining layers # and internal props c._props.update(self._props) layers = {} for k, v in self.registeredLayers(): layers[k] = v for k, v in other.registeredLayers(): layers[k] = v for k, v in layers.items(): c.registerLayer(k, v) return c | b9a35d44b511b5a532334179a24412a4695367d1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/b9a35d44b511b5a532334179a24412a4695367d1/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
4672,
276,
273,
4611,
1435,
468,
1660,
848,
1404,
999,
1089,
471,
3455,
326,
1353,
1427,
732,
741,
518,
10036,
364,
652,
316,
365,
18,
2821,
13332,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1289,
972,
12,
2890,
16,
1308,
4672,
276,
273,
4611,
1435,
468,
1660,
848,
1404,
999,
1089,
471,
3455,
326,
1353,
1427,
732,
741,
518,
10036,
364,
652,
316,
365,
18,
2821,
13332,
... |
testfiles = self.getTestFiles(testdir) if testfiles == None: continue | def runTests(self, xpcshell, xrePath=None, symbolsPath=None, manifest=None, testdirs=[], testPath=None, interactive=False, logfiles=True, debuggerInfo=None): """Run xpcshell tests. | 427937ff35ea20b5cbfb1e6dd1fb45dae71131c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11102/427937ff35ea20b5cbfb1e6dd1fb45dae71131c3/runxpcshelltests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
14650,
12,
2890,
16,
619,
2436,
10304,
16,
619,
266,
743,
33,
7036,
16,
7963,
743,
33,
7036,
16,
5643,
33,
7036,
16,
1842,
8291,
22850,
6487,
1842,
743,
33,
7036,
16,
12625,
33,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
14650,
12,
2890,
16,
619,
2436,
10304,
16,
619,
266,
743,
33,
7036,
16,
7963,
743,
33,
7036,
16,
5643,
33,
7036,
16,
1842,
8291,
22850,
6487,
1842,
743,
33,
7036,
16,
12625,
33,
... | |
print "HANDLE =",self.__HANDLE__ | def __init__(self,filename,access=sns_napi.ACC_READ): self.__HANDLE__=sns_napi.open(filename,access) if(self.__HANDLE__==None): raise SystemError,"Failed to read file: %s" % filename self.__filename = filename print "HANDLE =",self.__HANDLE__ | ddc4486e544131b845841d9545a8746cf7221761 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/762/ddc4486e544131b845841d9545a8746cf7221761/nexus_file.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3459,
16,
3860,
33,
87,
2387,
67,
2322,
77,
18,
31414,
67,
6949,
4672,
365,
16186,
23056,
972,
33,
87,
2387,
67,
2322,
77,
18,
3190,
12,
3459,
16,
3860... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3459,
16,
3860,
33,
87,
2387,
67,
2322,
77,
18,
31414,
67,
6949,
4672,
365,
16186,
23056,
972,
33,
87,
2387,
67,
2322,
77,
18,
3190,
12,
3459,
16,
3860... | |
return self._models_field_get(cr, uid, 'model_id.model', 'model_id.name', context) | return self._models_field_get(cr, uid, 'model', 'name', context) | def _models_get(self, cr, uid, context=None): return self._models_field_get(cr, uid, 'model_id.model', 'model_id.name', context) | ea9d350a598f8f1133d56c4cfc885d5d45c40ecc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/ea9d350a598f8f1133d56c4cfc885d5d45c40ecc/ir_property.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7665,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
327,
365,
6315,
7665,
67,
1518,
67,
588,
12,
3353,
16,
4555,
16,
296,
2284,
67,
350,
18,
2284,
2187,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7665,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
327,
365,
6315,
7665,
67,
1518,
67,
588,
12,
3353,
16,
4555,
16,
296,
2284,
67,
350,
18,
2284,
2187,
296,
... |
self.send( Packet("I'm here") ) | def connect(self, host, port): self.__addr = (host, port,) self.__socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) if self.__is_server: if self.verbose: print "Run server at %s:%u" % (self.host, self.port) self.__socket.bind(self.__addr) else: if self.verbose: print "Connect to server %s:%u" % (self.host, self.port) self.__server = UDP_Client(self, self.__addr) | 70e97dcbb405f676b38532857ba02d297697ddd0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2280/70e97dcbb405f676b38532857ba02d297697ddd0/udp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
12,
2890,
16,
1479,
16,
1756,
4672,
365,
16186,
4793,
273,
261,
2564,
16,
1756,
16,
13,
365,
16186,
7814,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
12,
2890,
16,
1479,
16,
1756,
4672,
365,
16186,
4793,
273,
261,
2564,
16,
1756,
16,
13,
365,
16186,
7814,
273,
2987,
18,
7814,
12,
7814,
18,
6799,
67,
18819,
16,
2987,
18,
3584,
... | |
self.conn.commit() | self.conn.commit() | def commit(self): | 34c41b6b2a05b0c448580a7fb8f0602d4ac4c768 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8941/34c41b6b2a05b0c448580a7fb8f0602d4ac4c768/informixdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3294,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.write_xml_property(model_el, model, prop_xml_name, prop_handler, blob_info_format) | if((includeProps is None) or (prop_xml_name in includeProps)): self.write_xml_property(model_el, model, prop_xml_name, prop_handler, blob_info_format) | def write_xml_value(self, model_el, model, blob_info_format): """Appends the properties of the given instance as xml elements to the given model element.""" # write key property first self.write_xml_property(model_el, model, KEY_PROPERTY_NAME, self.key_handler, blob_info_format) | 83840a06e62732f9109bdd292dad30cca3e3affd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4753/83840a06e62732f9109bdd292dad30cca3e3affd/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
2902,
67,
1132,
12,
2890,
16,
938,
67,
292,
16,
938,
16,
4795,
67,
1376,
67,
2139,
4672,
3536,
15049,
326,
1790,
434,
326,
864,
791,
487,
2025,
2186,
358,
326,
864,
938,
93... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2902,
67,
1132,
12,
2890,
16,
938,
67,
292,
16,
938,
16,
4795,
67,
1376,
67,
2139,
4672,
3536,
15049,
326,
1790,
434,
326,
864,
791,
487,
2025,
2186,
358,
326,
864,
938,
93... |
self.torrents[torrent_id] = (time.time(), result) | t = time.time() self.torrents[torrent_id] = (t, result) self.cache_times[torrent_id] = {} for key in result: self.cache_times[torrent_id][key] = t | def on_status(result): if result: self.torrents[torrent_id] = (time.time(), result) return result | a2d75a5274f647f148ec834c579e9de9575136a2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12915/a2d75a5274f647f148ec834c579e9de9575136a2/sessionproxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
2327,
12,
2088,
4672,
309,
563,
30,
268,
273,
813,
18,
957,
1435,
365,
18,
13039,
547,
87,
63,
13039,
547,
67,
350,
65,
273,
261,
88,
16,
563,
13,
365,
18,
2493,
67,
8293,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2327,
12,
2088,
4672,
309,
563,
30,
268,
273,
813,
18,
957,
1435,
365,
18,
13039,
547,
87,
63,
13039,
547,
67,
350,
65,
273,
261,
88,
16,
563,
13,
365,
18,
2493,
67,
8293,... |
self.img = self.__create_disk_img(file_img, file_size) self.loop = self.__attach_img_loop(self.img) self.__create_single_partition(self.loop) self.device = self.__create_entries_partition(self.loop) | self.img = self._create_disk_img(file_img, file_size) self.loop = self._attach_img_loop(self.img) self._create_single_partition(self.loop) self.device = self._create_entries_partition(self.loop) | def __init__(self, file_img, file_size): """ Creates a virtual partition, keeping record of the device created under /dev/mapper (device attribute) so test writers can use it on their filesystem tests. | 19d20874c897f5bf38b3aeae31edd6def4e52bcc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12268/19d20874c897f5bf38b3aeae31edd6def4e52bcc/base_partition.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
67,
6081,
16,
585,
67,
1467,
4672,
3536,
10210,
279,
5024,
3590,
16,
19966,
1409,
434,
326,
2346,
2522,
3613,
342,
5206,
19,
13919,
261,
5964,
1566,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
585,
67,
6081,
16,
585,
67,
1467,
4672,
3536,
10210,
279,
5024,
3590,
16,
19966,
1409,
434,
326,
2346,
2522,
3613,
342,
5206,
19,
13919,
261,
5964,
1566,
... |
tools.drop_view_if_exists(cr, 'stock_report_tracklots') | drop_view_if_exists(cr, 'stock_report_prodlots') | def init(self, cr): tools.drop_view_if_exists(cr, 'stock_report_tracklots') cr.execute(""" create or replace view stock_report_tracklots as ( select max(id) as id, location_id, product_id, tracking_id, sum(qty) as name from ( select -max(sm.id) as id, sm.location_id, sm.product_id, sm.tracking_id, -sum(sm.product_qty /uo.factor) as qty from stock_move as sm left join stock_location sl on (sl.id = sm.location_id) left join product_uom uo on (uo.id=sm.product_uom) where state = 'done' group by sm.location_id, sm.product_id, sm.product_uom, sm.tracking_id union all select max(sm.id) as id, sm.location_dest_id as location_id, sm.product_id, sm.tracking_id, sum(sm.product_qty /uo.factor) as qty from stock_move as sm left join stock_location sl on (sl.id = sm.location_dest_id) left join product_uom uo on (uo.id=sm.product_uom) where sm.state = 'done' group by sm.location_dest_id, sm.product_id, sm.product_uom, sm.tracking_id ) as report group by location_id, product_id, tracking_id )""") | 609058edda3ef483b46de9f5cb61bb3c1485b4b9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/609058edda3ef483b46de9f5cb61bb3c1485b4b9/report_stock.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1208,
12,
2890,
16,
4422,
4672,
3640,
67,
1945,
67,
430,
67,
1808,
12,
3353,
16,
296,
15381,
67,
6006,
67,
685,
5761,
6968,
6134,
4422,
18,
8837,
2932,
3660,
752,
578,
1453,
1476,
1248... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
4422,
4672,
3640,
67,
1945,
67,
430,
67,
1808,
12,
3353,
16,
296,
15381,
67,
6006,
67,
685,
5761,
6968,
6134,
4422,
18,
8837,
2932,
3660,
752,
578,
1453,
1476,
1248... |
this = apply(_quickfix.new_AggregatedBook, args) | this = _quickfix.new_AggregatedBook(*args) | def __init__(self, *args): this = apply(_quickfix.new_AggregatedBook, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
6078,
690,
9084,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
6078,
690,
9084,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
3... |
length = int(glGetObjectParameteriv(obj, GL_INFO_LOG_LENGTH)) | length = int(glGetShaderiv(obj, GL_INFO_LOG_LENGTH)) if length > 0: log = ctypes.create_string_buffer(length) baseOperation(obj, length, None, log) return log.value.strip('\000') return '' @lazy( glGetProgramInfoLog ) def glGetProgramInfoLog( baseOperation, obj ): """Retrieve the shader program's error messages as a Python string returns string which is '' if no message """ length = int(glGetProgramiv(obj, GL_INFO_LOG_LENGTH)) | def glGetShaderInfoLog( baseOperation, obj ): """Retrieve the shader's error messages as a Python string returns string which is '' if no message """ length = int(glGetObjectParameteriv(obj, GL_INFO_LOG_LENGTH)) if length > 0: log = ctypes.create_string_buffer(length) baseOperation(obj, length, None, log) return log.value.strip('\000') # null-termination return '' | 37b441ac3ad9eac59b64a4e7afa9f60ec9470325 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1545/37b441ac3ad9eac59b64a4e7afa9f60ec9470325/GL_2_0.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5118,
967,
19396,
966,
1343,
12,
1026,
2988,
16,
1081,
262,
30,
3536,
5767,
326,
16700,
1807,
555,
2743,
487,
279,
6600,
533,
225,
1135,
533,
1492,
353,
875,
309,
1158,
883,
3536,
769,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5118,
967,
19396,
966,
1343,
12,
1026,
2988,
16,
1081,
262,
30,
3536,
5767,
326,
16700,
1807,
555,
2743,
487,
279,
6600,
533,
225,
1135,
533,
1492,
353,
875,
309,
1158,
883,
3536,
769,
... |
_string = p.sub(r"\1$\\Leftarrow$\2", _string) | string = p.sub(r"\1$\\Leftarrow$\2", string) | def transform(string): """ convert/transform one line """ global frame_opened, enum_item_level # nasty thing to do global frame_header, frame_footer, next_frame_footer preamble = "" # for enumeration/itemize environment commands # handle itemizing/enumerations p = re.compile("^([\*\#]+).*$") m = p.match(string) if (m == None): my_enum_item_level = "" else: my_enum_item_level = m.group(1) # trivial: old level = new level if (my_enum_item_level == enum_item_level): pass else: # find common part common = -1 while (len(enum_item_level) > common + 1) and \ (len(my_enum_item_level) > common + 1) and \ (enum_item_level[common+1] == my_enum_item_level[common+1]): common = common + 1 # close enum_item_level environments from back to front for i in range(len(enum_item_level)-1, common, -1): if (enum_item_level[i] == "*"): preamble = preamble + "\\end{itemize}\n" elif (enum_item_level[i] == "#"): preamble = preamble + "\\end{enumerate}\n" # open my_enum_item_level environments from front to back for i in range(common+1, len(my_enum_item_level)): if (my_enum_item_level[i] == "*"): preamble = preamble + "\\begin{itemize}\n" elif (my_enum_item_level[i] == "#"): preamble = preamble + "\\begin{enumerate}\n" enum_item_level = my_enum_item_level # now, substitute item markers p = re.compile("^([\*\#]+)(.*)$") _string = p.sub(r" \\item\2", string) string = _string # header and footer definitions p = re.compile("^@FRAMEHEADER=(.*)$", re.VERBOSE) m = p.match(string) if (m != None): #print m.group(1) frame_header = m.group(1) string = "" p = re.compile("^@FRAMEFOOTER=(.*)$", re.VERBOSE) m = p.match(string) if (m != None): #print m.group(1) next_frame_footer = m.group(1) string = "" # detect manual closing of frames p = re.compile(r"(?:^\s*\\end{\s*frame\s*})|(?:^\[\s*frame\s*\]>)") if (frame_opened == 1): if (len(p.findall(string)) > 0): frame_opened = 0 # headings (3) to frames p = re.compile("^====\s*(.*?)\s*====(.*)", re.VERBOSE) if (frame_opened == 0): _string = p.sub(r"\\begin{frame}\2\n \\frametitle{\1}\n <---FRAMEHEADER---> \n", string) else: _string = p.sub(r" <---FRAMEFOOTER---> \n \\end{frame}\n\n\\begin{frame}\2\n \\frametitle{\1}\n <---FRAMEHEADER---> \n", string) if (string != _string): frame_opened = 1 # headings (2) to subsections string = _string p = re.compile("^===\s*(.*?)\s*===(.*)", re.VERBOSE) if (frame_opened == 1): _string = p.sub(r" <---FRAMEFOOTER---> \n \\end{frame}\n\\subsection\2{\1}\n\n", string) else: _string = p.sub(r"\n\\subsection\2{\1}\n\n", string) if (string != _string): frame_opened = 0 # headings (1) to sections string = _string p = re.compile("^==\s*(.*?)\s*==(.*)", re.VERBOSE) if (frame_opened == 1): _string = p.sub(r" <---FRAMEFOOTER---> \n \\end{frame}\n\n\\section\2{\1}\n\n", string) else: _string = p.sub(r"\n\n\\section\2{\1}\n\n", string) if (string != _string): frame_opened = 0 _string = _string.replace("<---FRAMEHEADER--->", frame_header) _string = _string.replace("<---FRAMEFOOTER--->", frame_footer) if (_string.find("\\end{frame}") != -1): frame_footer = next_frame_footer # latex environments, the users takes full responsibility # for closing ALL opened environments # exampe: # <[block]{block title} # message # [block]> # -> open p = re.compile("^<\[([^{}]*?)\]", re.VERBOSE) _string = p.sub(r"\\begin{\1}", _string) # -> close p = re.compile("^\[([^{}]*?)\]>", re.VERBOSE) _string = p.sub(r"\\end{\1}", _string) # columns p = re.compile("^\[\[\[(.*?)\]\]\]", re.VERBOSE) _string = p.sub(r"\\column{\1}", _string) # bold font p = re.compile("'''(.*?)'''", re.VERBOSE) _string = p.sub(r"\\textbf{\1}", _string) # italic font p = re.compile("''(.*?)''", re.VERBOSE) _string = p.sub(r"\\emph{\1}", _string) # typewriter font p = re.compile("@(.*?)@", re.VERBOSE) _string = p.sub(r"\\texttt{\1}", _string) # alerts p = re.compile("!(.*?)!", re.VERBOSE) _string = p.sub(r"\\alert{\1}", _string) # colors p = re.compile("_([^_\\\\]*?)_([^_]*?[^_\\\\])_", re.VERBOSE) _string = p.sub(r"\\textcolor{\1}{\2}", _string) # footnotes p = re.compile("\(\(\((.*?)\)\)\)", re.VERBOSE) _string = p.sub(r"\\footnote{\1}", _string) # figures/images p = re.compile("\<\<\<(.*?),(.*?)\>\>\>", re.VERBOSE) _string = p.sub(r"\\includegraphics[\2]{\1}", _string) p = re.compile("\<\<\<(.*?)\>\>\>", re.VERBOSE) _string = p.sub(r"\\includegraphics{\1}", _string) # substitutions p = re.compile("(\s)-->(\s)", re.VERBOSE) _string = p.sub(r"\1$\\rightarrow$\2", _string) p = re.compile("(\s)<--(\s)", re.VERBOSE) _string = p.sub(r"\1$\\leftarrow$\2", _string) p = re.compile("(\s)==>(\s)", re.VERBOSE) _string = p.sub(r"\1$\\Rightarrow$\2", _string) p = re.compile("(\s)<==(\s)", re.VERBOSE) _string = p.sub(r"\1$\\Leftarrow$\2", _string) p = re.compile("(\s):-\)(\s)", re.VERBOSE) _string = p.sub(r"\1\\smiley\2", _string) p = re.compile("(\s):-\((\s)", re.VERBOSE) _string = p.sub(r"\1\\frownie\2", _string) # to be continued ... return preamble + _string | 1947325dce6126afe82562ecb94d6cdf480ca241 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14466/1947325dce6126afe82562ecb94d6cdf480ca241/wiki2beamer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
12,
1080,
4672,
3536,
1765,
19,
6547,
1245,
980,
3536,
2552,
2623,
67,
25304,
16,
2792,
67,
1726,
67,
2815,
565,
468,
290,
689,
93,
7757,
358,
741,
2552,
2623,
67,
3374,
16,
2623... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2510,
12,
1080,
4672,
3536,
1765,
19,
6547,
1245,
980,
3536,
2552,
2623,
67,
25304,
16,
2792,
67,
1726,
67,
2815,
565,
468,
290,
689,
93,
7757,
358,
741,
2552,
2623,
67,
3374,
16,
2623... |
self["actions"] = ActionMap(["OkCancelActions", "ContextMenuActions"], | self["actions"] = ActionMap(["OkCancelActions", "MovieSelectionActions"], | def __init__(self, session, selectedmovie = None): Screen.__init__(self, session) self.movemode = False self.bouquet_mark_edit = False self.delayTimer = eTimer() self.delayTimer.timeout.get().append(self.updateHDDData) self["waitingtext"] = Label(_("Please wait... Loading list...")) self["list"] = MovieList(None) self.selectedmovie = selectedmovie #self["okbutton"] = Button("ok", [self.channelSelected]) self["freeDiskSpace"] = DiskInfo(resolveFilename(SCOPE_HDD), DiskInfo.FREE, update=False) self["actions"] = ActionMap(["OkCancelActions", "ContextMenuActions"], { "cancel": self.abort, "ok": self.movieSelected, "contextMenu": self.doContext, }) self["actions"].csel = self self.onShown.append(self.go) | 366798cd63b9250ce86e213e44c353fce1d722d0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/366798cd63b9250ce86e213e44c353fce1d722d0/MovieSelection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1339,
16,
3170,
8683,
13120,
273,
599,
4672,
10146,
16186,
2738,
972,
12,
2890,
16,
1339,
13,
225,
365,
18,
81,
1527,
351,
390,
273,
1083,
365,
18,
16818... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1339,
16,
3170,
8683,
13120,
273,
599,
4672,
10146,
16186,
2738,
972,
12,
2890,
16,
1339,
13,
225,
365,
18,
81,
1527,
351,
390,
273,
1083,
365,
18,
16818... |
plot = '"%s" binary array=inf format="%%float" using ($0*%f):%s title "%s" with lines' | plot = '"%s" binary array=inf format="%%float" using (($0 + 1)*%f):%s title "%s" with lines' | def spawn_gnuplot(title): # one gnuplot instance per plot to allow multiple *interactive* windows g = Gnuplot.Gnuplot() | 4412600f05bead73e6dc8645e06d770b370ae7d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10316/4412600f05bead73e6dc8645e06d770b370ae7d7/energy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12560,
67,
1600,
89,
4032,
12,
2649,
4672,
468,
1245,
314,
13053,
4032,
791,
1534,
3207,
358,
1699,
3229,
380,
24761,
14,
9965,
314,
273,
611,
13053,
4032,
18,
43,
13053,
4032,
1435,
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,
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,
12560,
67,
1600,
89,
4032,
12,
2649,
4672,
468,
1245,
314,
13053,
4032,
791,
1534,
3207,
358,
1699,
3229,
380,
24761,
14,
9965,
314,
273,
611,
13053,
4032,
18,
43,
13053,
4032,
1435,
2,
... |
CplusplusExtension('Affy._cel', | CplusplusExtension('Bio.Affy._cel', | def is_reportlab_installed(): return can_import("reportlab") | 930f61997ffa88dc280f57ba69c083f4921509b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7167/930f61997ffa88dc280f57ba69c083f4921509b8/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
6006,
7411,
67,
13435,
13332,
327,
848,
67,
5666,
2932,
6006,
7411,
7923,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
6006,
7411,
67,
13435,
13332,
327,
848,
67,
5666,
2932,
6006,
7411,
7923,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
langauge['cannot_connect_to_daemon'] = _("Can't connect to the daemon, trying to start it automatically...") | language['cannot_connect_to_daemon'] = _("Can't connect to the daemon, trying to start it automatically...") | def get_language_list_gui(): """ Returns a dict of translatable strings used by the GUI. Translations are done at http://wicd.net/translator. Please translate if you can. """ _ = get_gettext() language = {} language['connect'] = _("Connect") language['ip'] = _("IP") language['netmask'] = _("Netmask") language['gateway'] = _('Gateway') language['dns'] = _('DNS') language['use_static_ip'] = _('Use Static IPs') language['use_static_dns'] = _('Use Static DNS') language['use_encryption'] = _('Use Encryption') language['advanced_settings'] = _('Properties') language['wired_network'] = _('Wired Network') language['wired_network_instructions'] = _('To connect to a wired network,' ' you must create a network profile. To create a network profile, type a' ' name that describes this network, and press Add.') language['automatic_connect'] = _('Automatically connect to this network') language['secured'] = _('Secured') language['unsecured'] = _('Unsecured') language['channel'] = _('Channel') language['preferences'] = _('Preferences') language['wpa_supplicant_driver'] = _('WPA Supplicant Driver') language['wireless_interface'] = _('Wireless Interface') language['wired_interface'] = _('Wired Interface') language['hidden_network'] = _('Hidden Network') language['hidden_network_essid'] = _('Hidden Network ESSID') language['connected_to_wireless'] = _('Connected to $A at $B (IP: $C)') language['connected_to_wired'] = _('Connected to wired network (IP: $A)') language['not_connected'] = _('Not connected') language['no_wireless_networks_found'] = _('No wireless networks found.') language['killswitch_enabled'] = _('Wireless Kill Switch Enabled') language['key'] = _('Key') language['username'] = _('Username') language['password'] = _('Password') language['anonymous_identity'] = _('Anonymous Identity') language['identity'] = _('Identity') language['authentication'] = _('Authentication') language['path_to_pac_file'] = _('Path to PAC File') language['select_a_network'] = _('Choose from the networks below:') language['connecting'] = _('Connecting...') language['wired_always_on'] = _('Always show wired interface') language['auto_reconnect'] = _('Automatically reconnect on connection loss') language['create_adhoc_network'] = _('Create an Ad-Hoc Network') language['essid'] = _('ESSID') language['use_wep_encryption'] = _('Use Encryption (WEP only)') language['before_script'] = _('Run script before connect') language['after_script'] = _('Run script after connect') language['disconnect_script'] = _('Run disconnect script') language['script_settings'] = _('Scripts') language['use_ics'] = _('Activate Internet Connection Sharing') language['madwifi_for_adhoc'] = _('Check if using madwifi/atheros drivers') language['default_wired'] = _('Use as default profile (overwrites any previous default)') language['use_debug_mode'] = _('Enable debug mode') language['use_global_dns'] = _('Use global DNS servers') language['use_default_profile'] = _('Use default profile on wired autoconnect') language['show_wired_list'] = _('Prompt for profile on wired autoconnect') language['use_last_used_profile'] = _('Use last used profile on wired autoconnect') language['choose_wired_profile'] = _('Select or create a wired profile to connect with') language['wired_network_found'] = _('Wired connection detected') language['stop_showing_chooser'] = _('Stop Showing Autoconnect pop-up temporarily') language['display_type_dialog'] = _('Use dBm to measure signal strength') language['scripts'] = _('Scripts') language['invalid_address'] = _('Invalid address in $A entry.') language['global_settings'] = _('Use these settings for all networks sharing this essid') language['encrypt_info_missing'] = _('Required encryption information is missing.') language['enable_encryption'] = _('This network requires encryption to be enabled.') language['wicd_auto_config'] = _('Automatic (recommended)') language["gen_settings"] = _("General Settings") language["ext_programs"] = _("External Programs") language["dhcp_client"] = _("DHCP Client") language["wired_detect"] = _("Wired Link Detection") language["route_flush"] = _("Route Table Flushing") language["backend"] = _("Backend") language["backend_alert"] = _("Changes to your backend won't occur until the daemon is restarted.") language['dns_domain'] = _("DNS domain") language['search_domain'] = _("Search domain") language['global_dns_not_enabled'] = _("Global DNS has not been enabled in general preferences.") language['scripts_need_pass'] = _('You must enter your password to configure scripts') language['no_sudo_prog'] = _("Could not find a graphical sudo program. The script editor could not be launched." + " You'll have to edit scripts directly your configuration file.") language['0'] = _('0') language['1'] = _('1') language['2'] = _('2') language['3'] = _('3') language['4'] = _('4') language['5'] = _('5') language['6'] = _('6') language['7'] = _('7') language['8'] = _('8') language['9'] = _('9') language['interface_down'] = _('Putting interface down...') language['resetting_ip_address'] = _('Resetting IP address...') language['interface_up'] = _('Putting interface up...') language['setting_encryption_info'] = _('Setting encryption info') language['removing_old_connection'] = _('Removing old connection...') language['generating_psk'] = _('Generating PSK...') language['generating_wpa_config'] = _('Generating WPA configuration file...') language['flushing_routing_table'] = _('Flushing the routing table...') language['configuring_interface'] = _('Configuring wireless interface...') language['validating_authentication'] = _('Validating authentication...') language['setting_broadcast_address'] = _('Setting broadcast address...') language['setting_static_dns'] = _('Setting static DNS servers...') language['setting_static_ip'] = _('Setting static IP addresses...') language['running_dhcp'] = _('Obtaining IP address...') language['dhcp_failed'] = _('Connection Failed: Unable to Get IP Address') language['no_dhcp_offers'] = _('Connection Failed: No DHCP offers received.') language['aborted'] = _('Connection Cancelled') language['bad_pass'] = _('Connection Failed: Could not authenticate (bad password?)') language['done'] = _('Done connecting...') language['scanning'] = _('Scanning') language['scanning_stand_by'] = _('Scanning networks... stand by...') language['cannot_start_daemon'] = _("Unable to connect to wicd daemon DBus interface. " + \ "This typically means there was a problem starting the daemon. " + \ "Check the wicd log for more info") language['lost_dbus'] = _("The wicd daemon has shut down, the UI will not function properly until it is restarted.") language['configuring_wireless'] = _("Configuring preferences for wireless network \"$A\" ($B)") language['configuring_wired'] = _("Configuring preferences for wired profile \"$A\"") language['always_switch_to_wired'] = _("Always switch to wired connection when available") language['wired_autoconnect_settings'] = _("Wired Autoconnect Settings") language['always_use_wext'] = _("You should almost always use wext as the WPA supplicant driver") language['debugging'] = _("Debugging") language['wpa_supplicant'] = _("WPA Supplicant") language['automatic_reconnection'] = _("Automatic Reconnection") language['global_dns_servers'] = _("Global DNS servers") language['network_interfaces'] = _("Network Interfaces") language['connecting_to_daemon'] = _("Connecting to daemon...") langauge['cannot_connect_to_daemon'] = _("Can't connect to the daemon, trying to start it automatically...") language['could_not_connect'] = _("Could not connect to wicd's D-Bus interface. Check the wicd log for error messages.") language["exception"] = _("EXCEPTION! Please report this to the maintainer and file a bug report with the backtrace below:") language["brought_to_you"] = _("Brought to you by:") language["cannot_edit_scripts_1"] = _("To avoid various complications, wicd-curses does not support directly editing the scripts directly. However, you can edit them manually. First, (as root), open the "$A" config file, and look for the section labeled by the $B in question. In this case, this is:") language["cannot_edit_scripts_2"] = _('Once here, you can adjust (or add) the "beforescript", "afterscript", and "disconnectscript" variables as needed, to change the preconnect, postconnect, and disconnect scripts respectively. Alternatively, you can configure the wireless networks by ESSID, by looking for the "[<ESSID>]" field in the config file.') language["add_new_profile"] = _("Add a new profile") language["add_new_wired_profile"] = _("Add a new wired profile") language["no_delete_last_profile"] = _("wicd-curses does not support deleting the last wired profile. Try renaming it ('F2')") language["rename_wired_profile"] = _("Rename wired profile") language["select_hidden_essid"] = _("Select Hidden Network ESSID") language["esc_to_cancel"] = _("Press ESC to cancel") language["press_to_quit"] = _("Press F8 or Q to quit.") return language | 3d4cdcfd7aa176d65184b54e8192b5355a3b9b9d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/353/3d4cdcfd7aa176d65184b54e8192b5355a3b9b9d/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4923,
67,
1098,
67,
20292,
13332,
3536,
2860,
279,
2065,
434,
21884,
2064,
1399,
635,
326,
10978,
18,
225,
8193,
1012,
854,
2731,
622,
1062,
2207,
91,
335,
72,
18,
2758,
19,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4923,
67,
1098,
67,
20292,
13332,
3536,
2860,
279,
2065,
434,
21884,
2064,
1399,
635,
326,
10978,
18,
225,
8193,
1012,
854,
2731,
622,
1062,
2207,
91,
335,
72,
18,
2758,
19,
1... |
yield 'file', (afile, bfile, current_hunk) | yield 'file', ('a/' + afile, 'b/' + bfile, current_hunk) | def iterhunks(ui, fp, sourcefile=None): """Read a patch and yield the following events: - ("file", afile, bfile, firsthunk): select a new target file. - ("hunk", hunk): a new hunk is ready to be applied, follows a "file" event. - ("git", gitchanges): current diff is in git format, gitchanges maps filenames to gitpatch records. Unique event. """ changed = {} current_hunk = None afile = "" bfile = "" state = None hunknum = 0 emitfile = False git = False gitre = re.compile('diff --git (a/.*) (b/.*)') # our states BFILE = 1 context = None lr = linereader(fp) dopatch = True # gitworkdone is True if a git operation (copy, rename, ...) was # performed already for the current file. Useful when the file # section may have no hunk. gitworkdone = False while True: newfile = False x = lr.readline() if not x: break if current_hunk: if x.startswith('\ '): current_hunk.fix_newline() yield 'hunk', current_hunk current_hunk = None gitworkdone = False if ((sourcefile or state == BFILE) and ((not context and x[0] == '@') or ((context or context == None) and x.startswith('***************')))): try: if context == None and x.startswith('***************'): context = True gpatch = changed.get(bfile[2:]) create = afile == '/dev/null' or gpatch and gpatch.op == 'ADD' remove = bfile == '/dev/null' or gpatch and gpatch.op == 'DELETE' current_hunk = hunk(x, hunknum + 1, lr, context, create, remove) except PatchError, err: ui.debug(err) current_hunk = None continue hunknum += 1 if emitfile: emitfile = False yield 'file', (afile, bfile, current_hunk) elif state == BFILE and x.startswith('GIT binary patch'): current_hunk = binhunk(changed[bfile[2:]]) hunknum += 1 if emitfile: emitfile = False yield 'file', (afile, bfile, current_hunk) current_hunk.extract(lr) elif x.startswith('diff --git'): # check for git diff, scanning the whole patch file if needed m = gitre.match(x) if m: afile, bfile = m.group(1, 2) if not git: git = True dopatch, gitpatches = scangitpatch(lr, x) yield 'git', gitpatches for gp in gitpatches: changed[gp.path] = gp # else error? # copy/rename + modify should modify target, not source gp = changed.get(bfile[2:]) if gp and gp.op in ('COPY', 'DELETE', 'RENAME'): afile = bfile gitworkdone = True newfile = True elif x.startswith('---'): # check for a unified diff l2 = lr.readline() if not l2.startswith('+++'): lr.push(l2) continue newfile = True context = False afile = parsefilename(x) bfile = parsefilename(l2) elif x.startswith('***'): # check for a context diff l2 = lr.readline() if not l2.startswith('---'): lr.push(l2) continue l3 = lr.readline() lr.push(l3) if not l3.startswith("***************"): lr.push(l2) continue newfile = True context = True afile = parsefilename(x) bfile = parsefilename(l2) if newfile: emitfile = True state = BFILE hunknum = 0 if current_hunk: if current_hunk.complete(): yield 'hunk', current_hunk else: raise PatchError(_("malformed patch %s %s") % (afile, current_hunk.desc)) if hunknum == 0 and dopatch and not gitworkdone: raise NoHunks | b0ccc6c4afc2daea22e79b7bd96dda5f7dfb9bcc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11312/b0ccc6c4afc2daea22e79b7bd96dda5f7dfb9bcc/patch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
76,
1683,
87,
12,
4881,
16,
4253,
16,
1084,
768,
33,
7036,
4672,
3536,
1994,
279,
4729,
471,
2824,
326,
3751,
2641,
30,
300,
7566,
768,
3113,
279,
768,
16,
324,
768,
16,
1122,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
76,
1683,
87,
12,
4881,
16,
4253,
16,
1084,
768,
33,
7036,
4672,
3536,
1994,
279,
4729,
471,
2824,
326,
3751,
2641,
30,
300,
7566,
768,
3113,
279,
768,
16,
324,
768,
16,
1122,
... |
if self.closed: raise ValueError, "I/O operation on closed file" | _complain_ifclosed(self.closed) | def truncate(self, size=None): if self.closed: raise ValueError, "I/O operation on closed file" if size is None: size = self.pos elif size < 0: raise IOError(EINVAL, "Negative size not allowed") elif size < self.pos: self.pos = size self.buf = self.getvalue()[:size] | 7ed14235fb8a2cf10a7fc5527d04ef6e354b7712 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/7ed14235fb8a2cf10a7fc5527d04ef6e354b7712/StringIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10310,
12,
2890,
16,
963,
33,
7036,
4672,
389,
832,
7446,
67,
430,
12204,
12,
2890,
18,
12204,
13,
309,
963,
353,
599,
30,
963,
273,
365,
18,
917,
1327,
963,
411,
374,
30,
1002,
8340... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10310,
12,
2890,
16,
963,
33,
7036,
4672,
389,
832,
7446,
67,
430,
12204,
12,
2890,
18,
12204,
13,
309,
963,
353,
599,
30,
963,
273,
365,
18,
917,
1327,
963,
411,
374,
30,
1002,
8340... |
class BaseTestRoutesBinder(DingusTestCase(snakeroutes.RoutesBinder)): | class BaseTestRoutesBinder(DingusTestCase(snakeweb.RoutesBinder)): | def test_configure_mapper_is_not_implemented(self): self.module.configure(Dingus()) | 3e55c79e14b0d2fbe67f8019888a5605ac053074 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4277/3e55c79e14b0d2fbe67f8019888a5605ac053074/test_snakeroutes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14895,
67,
13919,
67,
291,
67,
902,
67,
21099,
12,
2890,
4672,
365,
18,
2978,
18,
14895,
12,
40,
310,
407,
10756,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
14895,
67,
13919,
67,
291,
67,
902,
67,
21099,
12,
2890,
4672,
365,
18,
2978,
18,
14895,
12,
40,
310,
407,
10756,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
reallink = '<a href="%s">%s</a>' % ( | reallink = '<a href=" | def docroutine(self, object, name=None, funcs={}, classes={}, methods={}, cl=None): """Produce HTML documentation for a function or method object.""" realname = object.__name__ name = name or realname anchor = (cl and cl.__name__ or '') + '-' + name note = '' skipdocs = 0 if inspect.ismethod(object): if cl: if not cl.__dict__.has_key(name): base = object.im_class url = '#%s-%s' % (base.__name__, name) basename = base.__name__ if base.__module__ != cl.__module__: url = base.__module__ + '.html' + url basename = base.__module__ + '.' + basename note = ' from <a href="%s">%s</a>' % (url, basename) skipdocs = 1 else: note = (object.im_self and ' method of ' + self.repr(object.im_self) or ' unbound %s method' % object.im_class.__name__) object = object.im_func | e280c06d5910eca5bcded37611033bb11bc17110 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e280c06d5910eca5bcded37611033bb11bc17110/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
22640,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
15630,
28793,
3318,
28793,
2590,
28793,
927,
33,
7036,
4672,
3536,
25884,
3982,
7323,
364,
279,
445,
578,
707,
733,
12123,
2863,
529... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
22640,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
15630,
28793,
3318,
28793,
2590,
28793,
927,
33,
7036,
4672,
3536,
25884,
3982,
7323,
364,
279,
445,
578,
707,
733,
12123,
2863,
529... |
def update_booklist(prefix, path, title, authors, mime, date, ContentType, ImageID, readstatus): | def update_booklist(prefix, path, title, authors, mime, date, ContentType, ImageID, readstatus, MimeType): | def update_booklist(prefix, path, title, authors, mime, date, ContentType, ImageID, readstatus): changed = False # if path_to_ext(path) in self.FORMATS: try: lpath = path.partition(self.normalize_path(prefix))[2] if lpath.startswith(os.sep): lpath = lpath[len(os.sep):] lpath = lpath.replace('\\', '/') # debug_print("LPATH: ", lpath, " - Title: " , title) | f81cd1413e030f2174ff61a9b71a66e1df1e06f0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/f81cd1413e030f2174ff61a9b71a66e1df1e06f0/driver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
3618,
1098,
12,
3239,
16,
589,
16,
2077,
16,
14494,
16,
4892,
16,
1509,
16,
11691,
16,
3421,
734,
16,
855,
2327,
16,
30913,
4672,
3550,
273,
1083,
468,
309,
589,
67,
869,
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,
1089,
67,
3618,
1098,
12,
3239,
16,
589,
16,
2077,
16,
14494,
16,
4892,
16,
1509,
16,
11691,
16,
3421,
734,
16,
855,
2327,
16,
30913,
4672,
3550,
273,
1083,
468,
309,
589,
67,
869,
6... |
if opt.input == stdin: dir = "" else: dir = os.path.dirname(os.path.abspath(opt.input.name)) | def convert_graphics(lines, opt): """ Add extension to filenames of insetgraphics if necessary. """ if opt.input == stdin: dir = "" else: dir = os.path.dirname(os.path.abspath(opt.input.name)) i = 0 while 1: i = find_token(lines, "\\begin_inset Graphics", i) if i == -1: return j = find_token2(lines, "filename", i) if j == -1: return i = i + 1 filename = split(lines[j])[1] absname = os.path.normpath(os.path.join(dir, filename)) if opt.input == stdin and not os.path.isabs(filename): # We don't know the directory and cannot check the file. # We could use a heuristic and take the current directory, # and we could try to find out if filename has an extension, # but that would be just guesses and could be wrong. opt.warning("""Warning: Can not determine wether file %s needs an extension when reading from standard input. You may need to correct the file manually or run lyx2lyx again with the .lyx file as commandline argument.""" % filename) continue # This needs to be the same algorithm as in pre 233 insetgraphics if access(absname, F_OK): continue if access(absname + ".ps", F_OK): lines[j] = replace(lines[j], filename, filename + ".ps") continue if access(absname + ".eps", F_OK): lines[j] = replace(lines[j], filename, filename + ".eps") | 17ec2aa0615913d8c9f3b36e133f302b287346a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7514/17ec2aa0615913d8c9f3b36e133f302b287346a0/lyx_1_4.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
31586,
12,
3548,
16,
2153,
4672,
3536,
1436,
2710,
358,
9066,
434,
316,
542,
31586,
309,
4573,
18,
3536,
277,
273,
374,
1323,
404,
30,
277,
273,
1104,
67,
2316,
12,
3548,
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,
1765,
67,
31586,
12,
3548,
16,
2153,
4672,
3536,
1436,
2710,
358,
9066,
434,
316,
542,
31586,
309,
4573,
18,
3536,
277,
273,
374,
1323,
404,
30,
277,
273,
1104,
67,
2316,
12,
3548,
16,... | |
("^" + timestamp + r'(\s*<.*>\s*)$', bygroups(Comment.Preproc, Name.Tag)), | ("^" + timestamp + r'(\s*<[^>]*>\s*)$', bygroups(Comment.Preproc, Name.Tag)), | def analyse_text(text): if text[:7] == 'Index: ': return True if text[:5] == 'diff ': return True if text[:4] == '--- ': return 0.9 | fda3ef9f1a1ad09c34a14f2a1b32ef4d35021f6c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6148/fda3ef9f1a1ad09c34a14f2a1b32ef4d35021f6c/text.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
67,
955,
12,
955,
4672,
309,
977,
10531,
27,
65,
422,
296,
1016,
30,
4290,
327,
1053,
309,
977,
10531,
25,
65,
422,
296,
5413,
4290,
327,
1053,
309,
977,
10531,
24,
65,
422,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31087,
67,
955,
12,
955,
4672,
309,
977,
10531,
27,
65,
422,
296,
1016,
30,
4290,
327,
1053,
309,
977,
10531,
25,
65,
422,
296,
5413,
4290,
327,
1053,
309,
977,
10531,
24,
65,
422,
3... |
request.content_type = content_type request.last_modified = timestamp | now = time.time() request.headers.add('Date', http_date(now)) request.headers.add('Content-Type', content_type) request.headers.add('Last-Modified', http_date(timestamp)) | def _do_box(pagename, request): _ = request.getText pagename, filename, fpath = _access_file(pagename, request) if not request.user.may.read(pagename): return _('You are not allowed to get attachments from this page.') if not filename: return # error msg already sent in _access_file timestamp = datetime.datetime.fromtimestamp(os.path.getmtime(fpath)) if_modified = request.if_modified_since if if_modified and if_modified >= timestamp: request.status_code = 304 else: ci = ContainerItem(request, pagename, filename) filename = wikiutil.taintfilename(request.values['member']) mt = wikiutil.MimeType(filename=filename) content_type = mt.content_type() mime_type = mt.mime_type() # TODO: fix the encoding here, plain 8 bit is not allowed according to the RFCs # There is no solution that is compatible to IE except stripping non-ascii chars filename_enc = filename.encode(config.charset) # for dangerous files (like .html), when we are in danger of cross-site-scripting attacks, # we just let the user store them to disk ('attachment'). # For safe files, we directly show them inline (this also works better for IE). dangerous = mime_type in request.cfg.mimetypes_xss_protect content_dispo = dangerous and 'attachment' or 'inline' request.content_type = content_type request.last_modified = timestamp #request.content_length = os.path.getsize(fpath) content_dispo_string = '%s; filename="%s"' % (content_dispo, filename_enc) request.headers.add('Content-Disposition', content_dispo_string) # send data request.send_file(ci.get(filename)) | 5d94d0bf02e58ca6f20d30fbed46eea39aa920e5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/5d94d0bf02e58ca6f20d30fbed46eea39aa920e5/AttachFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
2147,
12,
9095,
1069,
16,
590,
4672,
389,
273,
590,
18,
588,
1528,
225,
4262,
1069,
16,
1544,
16,
13543,
273,
389,
3860,
67,
768,
12,
9095,
1069,
16,
590,
13,
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,
389,
2896,
67,
2147,
12,
9095,
1069,
16,
590,
4672,
389,
273,
590,
18,
588,
1528,
225,
4262,
1069,
16,
1544,
16,
13543,
273,
389,
3860,
67,
768,
12,
9095,
1069,
16,
590,
13,
309,
486... |
if not name == last_name and len(urls) > 1: | if not name == last_name and len(main_urls) > 1: | def format(bfo, style, separator='; '): """ This is the default format for formatting full-text reference. @param separator the separator between urls. @param style CSS class of the link """ urls = bfo.fields("8564_") ret = "" #ret += "%s<br />" % urls bibarchive = BibRecDocs(bfo.recID) old_version_there = False main_urls = {} others_urls = {} cern_urls = {} additionals = False for complete_url in urls: if complete_url.has_key('u'): url = complete_url['u'] descr = '' #ret += "1 descr=%s<br />" % descr if complete_url.has_key('z'): #ret += "2 descr=%s<br />" % descr descr = complete_url['z'] #ret += "3 descr=%s<br />" % descr elif complete_url.has_key('y'): #ret += "2 descr=%s<br />" % descr descr = complete_url['y'] #ret += "3 descr=%s<br />" % descr #ret += "4 descr=%s<br />" % descr if not url.startswith(weburl): #ret += "%s doesn't start with %s<br />" % (url, weburl) #ret += "5 descr=%s<br />" % descr if not descr: if '/setlink?' in url: descr = "Fulltext" else: #ret += "6 descr=%s<br />" % descr descr = url.split('/')[-1] #ret += "7 descr=%s<br />" % descr #ret += "8 descr=%s<br />" % descr if 'cern.ch' in url: cern_urls[url] = descr else: others_urls[url] = descr else: #ret += "%s starts with %s!!!<br />" % (url, weburl) filename = url.split('/')[-1] name = file_strip_ext(filename) format = filename[len(name):] if format and format[0] == '.': format = format[1:] #ret += "%s -> (%s, %s, %s)<br />" % (url, filename, name, format) assigned = False for doc in bibarchive.listBibDocs(): if int(doc.getLatestVersion()) > 1: old_version_there = True #ret += "Sto operando sul file %s" % doc #ret += "%s<br />" % [f.fullname for f in doc.listAllFiles()] if filename in [f.fullname for f in doc.listAllFiles()]: assigned = True #ret += " --> ok!!!<br />" if not doc.type == 'Main': additionals = True #ret += "Additionals?!<br />" else: #ret += "Main!!!<br />" #ret += "9 descr=%s<br />" % descr if not descr: #ret += "10 descr=%s<br />" % descr descr = 'Main file(s)' #ret += "11 descr=%s<br />" % descr #ret += "12 descr=%s<br />" % descr if not main_urls.has_key(descr): main_urls[descr] = [] #ret += "Appendo a %s (%s, %s)<br />" % (descr, url, format) main_urls[descr].append((url, name, format)) if not assigned: if not descr: descr = url.split('/')[-1] others_urls[url] = descr if style != "": style = 'class="'+style+'"' # Build urls list. # Escape special chars for <a> tag value. additional_str = '' if additionals: additional_str = ' <small>(<a '+style+' href="'+weburl+'/record/'+str(bfo.recID)+'/files/">additional files</a>)</small>' versions_str = '' if old_version_there: versions_str = ' <small>(<a '+style+' href="'+weburl+'/record/'+str(bfo.recID)+'/files/">older versions</a>)</small>' if main_urls: last_name = "" for descr, urls in main_urls.items(): ret += "<strong>"+descr+":</strong> " url_list = [] urls.sort(lambda (url1, name1, format1), (url2, name2, format2): url1 < url2 and -1 or url1 > url2 and 1 or 0) for url, name, format in urls: if not name == last_name and len(urls) > 1: print_name = "<em>%s</em> - " % name else: print_name = "" last_name = name url_list.append(print_name + '<a '+style+' href="'+escape(url)+'">'+format.upper()+'</a>') ret += separator.join(url_list) + additional_str + versions_str + '<br />' if cern_urls: ret += '<strong>CERN links</strong>: ' url_list = [] for url,descr in cern_urls.items(): url_list.append('<a '+style+' href="'+escape(url)+'">'+escape(str(descr))+'</a>') ret += separator.join(url_list) + '<br />' if others_urls: ret += '<strong>External links</strong>: ' url_list = [] for url,descr in others_urls.items(): url_list.append('<a '+style+' href="'+escape(url)+'">'+escape(str(descr))+'</a>') ret += separator.join(url_list) + '<br />' if ret.endswith('<br />'): ret = ret[:-len('<br />')] return ret | 35c8319cf9220490b56806cac2ae7cbda82fd471 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12027/35c8319cf9220490b56806cac2ae7cbda82fd471/bfe_fulltext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
70,
617,
16,
2154,
16,
4182,
2218,
31,
296,
4672,
3536,
1220,
353,
326,
805,
740,
364,
10407,
1983,
17,
955,
2114,
18,
632,
891,
4182,
326,
4182,
3086,
6903,
18,
632,
891,
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,
740,
12,
70,
617,
16,
2154,
16,
4182,
2218,
31,
296,
4672,
3536,
1220,
353,
326,
805,
740,
364,
10407,
1983,
17,
955,
2114,
18,
632,
891,
4182,
326,
4182,
3086,
6903,
18,
632,
891,
2... |
We have a(15)=2 because 15 = 4+5+6 and 15 = 1+2+3+4+5. The number of odd divisors of 15 is 4. | We have a(15)=2 because 15 = 4+5+6 and 15 = 1+2+3+4+5. The number of odd divisors of 15 is 4. | def is_number_of_the_third_kind(self, n): r""" This function returns True if and only if $n$ is a number of the third kind. | da9c7077d971928cf55f4cb1660269f1a93e0d92 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/da9c7077d971928cf55f4cb1660269f1a93e0d92/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2696,
67,
792,
67,
5787,
67,
451,
6909,
67,
9224,
12,
2890,
16,
290,
4672,
436,
8395,
1220,
445,
1135,
1053,
309,
471,
1338,
309,
271,
82,
8,
353,
279,
1300,
434,
326,
12126... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2696,
67,
792,
67,
5787,
67,
451,
6909,
67,
9224,
12,
2890,
16,
290,
4672,
436,
8395,
1220,
445,
1135,
1053,
309,
471,
1338,
309,
271,
82,
8,
353,
279,
1300,
434,
326,
12126... |
if not _are_equal(xr, xi) and _are_equal(yr, yi): | if not (_are_equal(xr, yr) and _are_equal(xi, yi)): | def assert_equal_spec(x, y): # Barf if x and y are not both complex or real right away if (np.iscomplexobj(x) and not np.iscomplexobj(y)) \ or (not np.iscomplexobj(x) and np.iscomplexobj(y)): raise AssertionError("Items are not equal:\n" \ "ACTUAL: %s\n" \ "DESIRED: %s\n" % (str(x), str(y))) if np.iscomplexobj(x): xr = np.real(x) yr = np.real(y) xi = np.imag(x) yi = np.imag(y) if not _are_equal(xr, xi) and _are_equal(yr, yi): raise AssertionError("Items are not equal:\n" \ "ACTUAL: %s\n" \ "DESIRED: %s\n" % (str(x), str(y))) else: if not _are_equal(x, y): raise AssertionError("Items are not equal:\n" \ "ACTUAL: %s\n" \ "DESIRED: %s\n" % (str(x), str(y))) | 74bca4fa9262d365eda8f59932c0d5bc86582f4b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/14925/74bca4fa9262d365eda8f59932c0d5bc86582f4b/test_umath_complex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
67,
9729,
67,
2793,
12,
92,
16,
677,
4672,
468,
16654,
74,
309,
619,
471,
677,
854,
486,
3937,
7233,
578,
2863,
2145,
10804,
309,
261,
6782,
18,
291,
14259,
2603,
12,
92,
13,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
67,
9729,
67,
2793,
12,
92,
16,
677,
4672,
468,
16654,
74,
309,
619,
471,
677,
854,
486,
3937,
7233,
578,
2863,
2145,
10804,
309,
261,
6782,
18,
291,
14259,
2603,
12,
92,
13,
4... |
def fl_set_slider_step(ob, value): """ fl_set_slider_step(ob, value) """ _fl_set_slider_step(ob, value) | def fl_set_slider_step(pObject, value): """ fl_set_slider_step(pObject, value) """ _fl_set_slider_step(pObject, value) | def fl_set_slider_step(ob, value): """ fl_set_slider_step(ob, value) """ _fl_set_slider_step(ob, value) | 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,
542,
67,
28372,
67,
4119,
12,
84,
921,
16,
460,
4672,
3536,
1183,
67,
542,
67,
28372,
67,
4119,
12,
84,
921,
16,
460,
13,
3536,
225,
389,
2242,
67,
542,
67,
28372,
67,
41... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
28372,
67,
4119,
12,
84,
921,
16,
460,
4672,
3536,
1183,
67,
542,
67,
28372,
67,
4119,
12,
84,
921,
16,
460,
13,
3536,
225,
389,
2242,
67,
542,
67,
28372,
67,
41... |
stream = g.objectstore.query(Stream).get(value) print "stream found is %s" % stream return stream | return g.objectstore.query(Stream).get(value) | def _to_python(self, value, state): stream = g.objectstore.query(Stream).get(value) print "stream found is %s" % stream return stream | da3c8f01b2f0218f79af25ccba7f14ed9d35a27b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12856/da3c8f01b2f0218f79af25ccba7f14ed9d35a27b/proposal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
869,
67,
8103,
12,
2890,
16,
460,
16,
919,
4672,
327,
314,
18,
1612,
2233,
18,
2271,
12,
1228,
2934,
588,
12,
1132,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
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,
869,
67,
8103,
12,
2890,
16,
460,
16,
919,
4672,
327,
314,
18,
1612,
2233,
18,
2271,
12,
1228,
2934,
588,
12,
1132,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
reactor.connectTCP(self.host, self.port, factory) | reactor.connectTCP(host, port, factory) | def doSCGI(request, host, port): if request.stream.length is None: return http.Response(responsecode.LENGTH_REQUIRED) factory = SCGIClientProtocolFactory(request) reactor.connectTCP(self.host, self.port, factory) return factory.deferred | f80aba28cf6b830050442d04c4cf1b220d2d07bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/f80aba28cf6b830050442d04c4cf1b220d2d07bb/twscgi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
2312,
13797,
12,
2293,
16,
1479,
16,
1756,
4672,
309,
590,
18,
3256,
18,
2469,
353,
599,
30,
327,
1062,
18,
1064,
12,
2740,
710,
18,
7096,
67,
14977,
13,
3272,
273,
8795,
13797,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
2312,
13797,
12,
2293,
16,
1479,
16,
1756,
4672,
309,
590,
18,
3256,
18,
2469,
353,
599,
30,
327,
1062,
18,
1064,
12,
2740,
710,
18,
7096,
67,
14977,
13,
3272,
273,
8795,
13797,
... |
self.assertEquals(DELETE_COUNTER.get(orig_url), 0) | def test_rename(self): obj_id = 'demodoc' new_id = 'new_demodoc' doc = makeContent(self.folder, portal_type='Fact', id=obj_id) content = 'The book is on the table!' doc.setQuote(content, mimetype="text/plain") orig_url = doc.absolute_url() self.failUnless(str(doc.getQuote()) == str(content)) #make sure we have _p_jar get_transaction().commit(1) self.folder.manage_renameObject(obj_id, new_id) doc = getattr(self.folder, new_id) self.failUnless(str(doc.getQuote()) == str(content)) uid = UID(doc) # Should call afterAdd twice, one for the object # creation and another for the rename self.assertEquals(ADD_COUNTER.get(orig_url), 1) self.assertEquals(ADD_COUNTER.get(uid), 1) # Should call beforeDelete once, when renaming the object self.assertEquals(DELETE_COUNTER.get(orig_url), 0) self.assertEquals(DELETE_COUNTER.get(uid), 1) # Should never call afterClone self.assertEquals(CLONE_COUNTER.get(orig_url), 0) self.assertEquals(CLONE_COUNTER.get(uid), 0) | 49fd1fc877cc263bec78f0818eeec475d277e73c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/49fd1fc877cc263bec78f0818eeec475d277e73c/test_rename.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
18539,
12,
2890,
4672,
1081,
67,
350,
273,
296,
323,
1711,
504,
11,
394,
67,
350,
273,
296,
2704,
67,
323,
1711,
504,
11,
997,
273,
1221,
1350,
12,
2890,
18,
5609,
16,
1189... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18539,
12,
2890,
4672,
1081,
67,
350,
273,
296,
323,
1711,
504,
11,
394,
67,
350,
273,
296,
2704,
67,
323,
1711,
504,
11,
997,
273,
1221,
1350,
12,
2890,
18,
5609,
16,
1189... | |
debugger.enabled = False | debugger.enabled = False | def testEventDispatch(self): global debugger self.assert_(not debugger.enabled) debugger.onBreak = lambda evt: self.processDebugEvent(evt) debugger.onException = lambda evt: self.processDebugEvent(evt) debugger.onNewFunction = lambda evt: self.processDebugEvent(evt) debugger.onBeforeCompile = lambda evt: self.processDebugEvent(evt) debugger.onAfterCompile = lambda evt: self.processDebugEvent(evt) with JSContext() as ctxt: debugger.enabled = True self.assertEquals(3, int(ctxt.eval("function test() { text = \"1+2\"; return eval(text) } test()"))) debugger.enabled = False self.assertRaises(JSError, JSContext.eval, ctxt, "throw 1") self.assert_(not debugger.enabled) self.assertEquals(4, len(self.events)) | 39238494c6380764c75b46d3d726c011640ecf54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5828/39238494c6380764c75b46d3d726c011640ecf54/PyV8.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1133,
5325,
12,
2890,
4672,
2552,
19977,
225,
365,
18,
11231,
67,
12,
902,
19977,
18,
5745,
13,
225,
19977,
18,
265,
7634,
273,
3195,
6324,
30,
365,
18,
2567,
2829,
1133,
12,
73,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1133,
5325,
12,
2890,
4672,
2552,
19977,
225,
365,
18,
11231,
67,
12,
902,
19977,
18,
5745,
13,
225,
19977,
18,
265,
7634,
273,
3195,
6324,
30,
365,
18,
2567,
2829,
1133,
12,
73,... |
if pat.match(lines[i]): return lines, i | match = pat.match(lines[i]) if match: if lines[i][0] == 'c': return lines, i candidates.append((match.group(1), i)) if candidates: candidates.sort() return lines, candidates[0][1] | def findsource(object): """Return the entire source file and starting line number for an object. The argument may be a module, class, method, function, traceback, frame, or code object. The source code is returned as a list of all the lines in the file and the line number indexes a line in that list. An IOError is raised if the source code cannot be retrieved.""" file = getsourcefile(object) or getfile(object) module = getmodule(object, file) if module: lines = linecache.getlines(file, module.__dict__) else: lines = linecache.getlines(file) if not lines: raise IOError('could not get source code') if ismodule(object): return lines, 0 if isclass(object): name = object.__name__ pat = re.compile(r'^\s*class\s*' + name + r'\b') for i in range(len(lines)): if pat.match(lines[i]): return lines, i else: raise IOError('could not find class definition') if ismethod(object): object = object.im_func if isfunction(object): object = object.func_code if istraceback(object): object = object.tb_frame if isframe(object): object = object.f_code if iscode(object): if not hasattr(object, 'co_firstlineno'): raise IOError('could not find function definition') lnum = object.co_firstlineno - 1 pat = re.compile(r'^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)') while lnum > 0: if pat.match(lines[lnum]): break lnum = lnum - 1 return lines, lnum raise IOError('could not find code object') | 7d2f74700fe9e9d3d588753dc3cf06b2d585cfd8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/7d2f74700fe9e9d3d588753dc3cf06b2d585cfd8/inspect.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
3168,
12,
1612,
4672,
3536,
990,
326,
7278,
1084,
585,
471,
5023,
980,
1300,
364,
392,
733,
18,
225,
1021,
1237,
2026,
506,
279,
1605,
16,
667,
16,
707,
16,
445,
16,
10820,
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,
1104,
3168,
12,
1612,
4672,
3536,
990,
326,
7278,
1084,
585,
471,
5023,
980,
1300,
364,
392,
733,
18,
225,
1021,
1237,
2026,
506,
279,
1605,
16,
667,
16,
707,
16,
445,
16,
10820,
16,
... |
map=socket_map | map = socket_map | def close_all (map=None): if map is None: map=socket_map for x in map.values(): x.socket.close() map.clear() | 79991224d1b5f3a4ab074ddac83ef59addf853be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/79991224d1b5f3a4ab074ddac83ef59addf853be/asyncore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
454,
261,
1458,
33,
7036,
4672,
309,
852,
353,
599,
30,
852,
273,
2987,
67,
1458,
364,
619,
316,
852,
18,
2372,
13332,
619,
18,
7814,
18,
4412,
1435,
852,
18,
8507,
1435,
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,
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,
1746,
67,
454,
261,
1458,
33,
7036,
4672,
309,
852,
353,
599,
30,
852,
273,
2987,
67,
1458,
364,
619,
316,
852,
18,
2372,
13332,
619,
18,
7814,
18,
4412,
1435,
852,
18,
8507,
1435,
2... |
port = open("/dev/usb/tts/0", "rb") bits = '' noise = 0 flag = "011110" | port = open(device, "rb") | def receiveBits(): bitCounts = createBitCountTable() port = open("/dev/usb/tts/0", "rb") bits = '' noise = 0 flag = "011110" while 1: # Each byte read from the serial port is actually one bit # of data. We can measure noise by checking how closely it # matches the ideal bit patterns. b = port.read(1) if bitCounts[ord(b)] < 4: noise += bitCounts[ord(b) ^ 0xC0] bits += "1" else: noise += bitCounts[ord(b) ^ 0xFC] bits += "0" # Put an upper limit on the buffer size if len(bits) > 1024: bits = '' noise = 0 # If we've received a flag, examine the contents. It might be a valid packet if bits.endswith(flag): # Measure the percentage of total sub-bits received that were different from the ideal patterns noiseRatio = noise / (len(bits) * 8.0) noise = 0 # If we're receiving completely random data, the noise ratio will be about 1/3. Scale it so # that 1/3 noise is a signal strength of 0, and no noise is a signal strength of 100% signalStrength = (1 - min(noiseRatio, 1.0/3.0) * 3) * 100.0 receivedRawPacket(bits[:-len(flag)], signalStrength) bits = '' | eed327997b9a1dc28319f2e2f8db82292b53d359 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6757/eed327997b9a1dc28319f2e2f8db82292b53d359/rx-test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6798,
6495,
13332,
2831,
9211,
273,
752,
5775,
1380,
1388,
1435,
1756,
273,
1696,
12,
5964,
16,
315,
6731,
7923,
225,
1323,
404,
30,
468,
8315,
1160,
855,
628,
326,
2734,
1756,
353,
6013... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6798,
6495,
13332,
2831,
9211,
273,
752,
5775,
1380,
1388,
1435,
1756,
273,
1696,
12,
5964,
16,
315,
6731,
7923,
225,
1323,
404,
30,
468,
8315,
1160,
855,
628,
326,
2734,
1756,
353,
6013... |
from Components.config import ConfigSubsection, configSequence, configElement, configsequencearg | def popSummary(self): if self.summary is not None: self.summary.doClose() self.summary = self.summary_stack.pop() if self.summary is not None: self.summary.show() | 03379b6e86edfcce851da2d11c3189d1b7843afb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/03379b6e86edfcce851da2d11c3189d1b7843afb/mytest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1843,
4733,
12,
2890,
4672,
309,
365,
18,
7687,
353,
486,
599,
30,
365,
18,
7687,
18,
2896,
4605,
1435,
365,
18,
7687,
273,
365,
18,
7687,
67,
3772,
18,
5120,
1435,
309,
365,
18,
768... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1843,
4733,
12,
2890,
4672,
309,
365,
18,
7687,
353,
486,
599,
30,
365,
18,
7687,
18,
2896,
4605,
1435,
365,
18,
7687,
273,
365,
18,
7687,
67,
3772,
18,
5120,
1435,
309,
365,
18,
768... | |
self.prelink_hook() | if self.compiler.compiler_type == 'msvc': self.msvc_prelink_hack(sources, ext, extra_args) | def build_extensions (self): | 1a5dae80130b8295865f2c9455b28a72efc63ac3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/1a5dae80130b8295865f2c9455b28a72efc63ac3/build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
9489,
261,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
9489,
261,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
cfg["vcpus_params"]["weight"] = \ int(sxp.child_value(sxp_cfg, "cpu_weight", 256)) cfg["vcpus_params"]["cap"] = \ int(sxp.child_value(sxp_cfg, "cpu_cap", 0)) | if not cfg["vcpus_params"].has_key("weight"): cfg["vcpus_params"]["weight"] = \ int(sxp.child_value(sxp_cfg, "cpu_weight", 256)) if not cfg["vcpus_params"].has_key("cap"): cfg["vcpus_params"]["cap"] = \ int(sxp.child_value(sxp_cfg, "cpu_cap", 0)) | def _parse_sxp(self, sxp_cfg): """ Populate this XendConfig using the parsed SXP. | 8f9cd97f0494eadd21b1598e01c0fe9047474712 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6195/8f9cd97f0494eadd21b1598e01c0fe9047474712/XendConfig.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
87,
23829,
12,
2890,
16,
13280,
84,
67,
7066,
4672,
3536,
22254,
333,
1139,
409,
809,
1450,
326,
2707,
348,
60,
52,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
67,
87,
23829,
12,
2890,
16,
13280,
84,
67,
7066,
4672,
3536,
22254,
333,
1139,
409,
809,
1450,
326,
2707,
348,
60,
52,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if 'CREATE' in req.perm(context('attachment')): | if 'WIKI_MODIFY' in req.perm(context): | def _render_view(self, context): page = context.resource req = context.req | d88dea012b625cacfecabcdac9c051323c5e174a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2831/d88dea012b625cacfecabcdac9c051323c5e174a/web_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1945,
12,
2890,
16,
819,
4672,
1363,
273,
819,
18,
3146,
1111,
273,
819,
18,
3658,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5902,
67,
1945,
12,
2890,
16,
819,
4672,
1363,
273,
819,
18,
3146,
1111,
273,
819,
18,
3658,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def setFlavorPreferences(flavorPreferences): | def setFlavorPreferences(self, flavorPreferences): | def setFlavorPreferences(flavorPreferences): self.flavorPreferences = flavorPreferences | 78dfa4726f29c08657a90ae9cca3fdc61801d332 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8747/78dfa4726f29c08657a90ae9cca3fdc61801d332/resolvemethod.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2340,
9444,
12377,
12,
2890,
16,
19496,
12377,
4672,
365,
18,
2242,
9444,
12377,
273,
19496,
12377,
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,
444,
2340,
9444,
12377,
12,
2890,
16,
19496,
12377,
4672,
365,
18,
2242,
9444,
12377,
273,
19496,
12377,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.log.error('Unable to export %s: %s' % (self.location, e)) | self.log.error('Unable to export %s: %s' % (source, e)) | def export_source(self, source, tmp, target): self.log.debug('Exporting %s to %s' % (self.location, target) | 50c3e0b41e195ec97d16b32803b3ac9dac300f4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13693/50c3e0b41e195ec97d16b32803b3ac9dac300f4d/tarball.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
3168,
12,
2890,
16,
1084,
16,
1853,
16,
1018,
4672,
365,
18,
1330,
18,
4148,
2668,
6144,
310,
738,
87,
358,
738,
87,
11,
738,
261,
2890,
18,
3562,
16,
1018,
13,
2,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3359,
67,
3168,
12,
2890,
16,
1084,
16,
1853,
16,
1018,
4672,
365,
18,
1330,
18,
4148,
2668,
6144,
310,
738,
87,
358,
738,
87,
11,
738,
261,
2890,
18,
3562,
16,
1018,
13,
2,
-100,
... |
self._render() | def _set_scroll_step(self, step, orientation): """ Callback from the animation """ self._render() # move children if orientation == Grid.HORIZONTAL: self._x0 -= step x, y = step, 0 if orientation == Grid.VERTICAL: self._y0 -= step x, y = 0, step for child in self.get_children(): child.move_by(x, y) | 572f292cd6c4cb21a58e9c35f4bec5f39fc4a0df /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11702/572f292cd6c4cb21a58e9c35f4bec5f39fc4a0df/grid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
12033,
67,
4119,
12,
2890,
16,
2235,
16,
9820,
4672,
3536,
8444,
628,
326,
8794,
3536,
468,
3635,
2325,
309,
9820,
422,
7145,
18,
44,
20344,
30,
365,
6315,
92,
20,
3947,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
542,
67,
12033,
67,
4119,
12,
2890,
16,
2235,
16,
9820,
4672,
3536,
8444,
628,
326,
8794,
3536,
468,
3635,
2325,
309,
9820,
422,
7145,
18,
44,
20344,
30,
365,
6315,
92,
20,
3947,
... | |
if product is not None: self.__of__(product)._register() | def __init__(self, id, title, object_type, initial, product=None): self.id=id self.title=title self.object_type=object_type self.initial=initial if product is not None: self.__of__(product)._register() | 53621b5296c7b1d8bf8bfb9857eee01df2f9794e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/53621b5296c7b1d8bf8bfb9857eee01df2f9794e/Factory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
612,
16,
2077,
16,
733,
67,
723,
16,
2172,
16,
3017,
33,
7036,
4672,
365,
18,
350,
33,
350,
365,
18,
2649,
33,
2649,
365,
18,
1612,
67,
723,
33,
1612... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
612,
16,
2077,
16,
733,
67,
723,
16,
2172,
16,
3017,
33,
7036,
4672,
365,
18,
350,
33,
350,
365,
18,
2649,
33,
2649,
365,
18,
1612,
67,
723,
33,
1612... | |
originating_locations = [20, 2001, 2002, 2003] | originating_locations = [20, 2001, 2002, 2003,2004] stock_levels = dict([[loc, random.randint(1, 10000) * 10 + 50000] for loc in originating_locations]) | def testFixture(self): """"This isn't actually a test. It just takes advantage of the test harness to spam a bunch of messages to the supply app and spit out the data in a format that can be sucked into a fixture""" # this is the number of transactions that will be generated transaction_count = 50 # these are the locations that will be the origins, chosen randomly # from this list # the destinations will be chosen randomly from the origins' children originating_locations = [20, 2001, 2002, 2003] # the sender will always be the same, for now phone = "55555" all_txns = [] # these are the percentages these items will match waybill_match_percent = .9 amount_match_percent = .9 loc_match_percent = .95 num_locs = len(Location.objects.all()) # allow specifying the minimum and maximum dates for message generation min_date = datetime(2009,4,1) max_date = datetime(2009,4,30) min_time = time.mktime(min_date.timetuple()) max_time = time.mktime(max_date.timetuple()) for i in range(transaction_count): # get some random data based on the parameters we've set above origin = Location.objects.get(code=random.choice(originating_locations )) destination = random.choice(origin.children.all()) waybill = random.randint(10000,99999) amount = random.randint(1, 500) * 10 stock = random.randint(1, 3000) * 10 date = datetime.fromtimestamp(random.randint(min_time, max_time)) issue_string = "%s@%s > llin issue from %s to %s %s %s %s" % (phone, date.strftime("%Y%m%d%H%M"), origin.code, destination.code, waybill, amount, stock) all_txns.append(issue_string) # create a waybill number based on the likelihood of match if random.random() < waybill_match_percent: ret_waybill = waybill else: ret_waybill = random.randint(10000,99999) # create an amount based on the likelihood of match if random.random() < amount_match_percent: ret_amount = amount else: ret_amount = random.randint(1, 500) * 10 # create an origin and destination based on the likelihood of match if random.random() < loc_match_percent: ret_orig = origin else: ret_orig = Location.objects.get(pk=random.randint(1,num_locs)) if random.random() < loc_match_percent: ret_dest = destination else: ret_dest = Location.objects.get(pk=random.randint(1, num_locs)) # make sure the stock at the receiver is higher than the amount of the bill ret_stock = random.randint(1, 2000) * 10 + ret_amount # make sure the date received is after the date sent ret_date = datetime.fromtimestamp(random.randint(time.mktime(date.timetuple()), max_time)) receive_string = "%s@%s > llin receive from %s to %s %s %s %s" % (phone, ret_date.strftime("%Y%m%d%H%M"), ret_orig.code, ret_dest.code, ret_waybill, ret_amount, ret_stock) all_txns.append(receive_string) script = "\n".join(all_txns) self.runScript(script) dumpdata = Command() print "\n\n=========This is your fixture. Copy and paste it to a text file========\n\n" print dumpdata.handle("supply") | 10de2c4f7545836b49dff712cb464a45f66355d1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11809/10de2c4f7545836b49dff712cb464a45f66355d1/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
26392,
12,
2890,
4672,
3536,
6,
2503,
5177,
1404,
6013,
279,
1842,
18,
225,
2597,
2537,
5530,
1261,
7445,
410,
434,
326,
1842,
366,
1303,
403,
358,
24824,
279,
25606,
434,
2743,
35... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
26392,
12,
2890,
4672,
3536,
6,
2503,
5177,
1404,
6013,
279,
1842,
18,
225,
2597,
2537,
5530,
1261,
7445,
410,
434,
326,
1842,
366,
1303,
403,
358,
24824,
279,
25606,
434,
2743,
35... |
self._out.write('\n') | self._out.write('\n\n') | def render(self, header = 1): """ Figures out flavours and such and then renders the content according to which flavour we're using. | 3c38de2985ac7835eb24df6c06a0717e9359c870 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11836/3c38de2985ac7835eb24df6c06a0717e9359c870/blosxom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1446,
273,
404,
4672,
3536,
478,
360,
1823,
596,
31227,
4390,
471,
4123,
471,
1508,
19567,
326,
913,
4888,
358,
1492,
31227,
477,
732,
4565,
1450,
18,
2,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
1446,
273,
404,
4672,
3536,
478,
360,
1823,
596,
31227,
4390,
471,
4123,
471,
1508,
19567,
326,
913,
4888,
358,
1492,
31227,
477,
732,
4565,
1450,
18,
2,
-100,
-100,
... |
self.RunDemo(itemText) def RunDemo(self, itemText): os.chdir(self.cwd) if self.nb.GetPageCount() == 3: if self.nb.GetSelection() == 2: self.nb.SetSelection(0) | self.LoadDemo(itemText) def LoadDemo(self, demoName): try: wx.BeginBusyCursor() os.chdir(self.cwd) self.ShutdownDemoModule() if demoName == self.overviewText: self.demoModules = DemoModules(__name__) self.SetOverview(self.overviewText, mainOverview) self.LoadDemoSource() self.UpdateNotebook(0) else: if os.path.exists(GetOriginalFilename(demoName)): wx.LogMessage("Loading demo %s.py..." % demoName) self.demoModules = DemoModules(demoName) self.LoadDemoSource() self.tree.Refresh() else: self.SetOverview("wxPython", mainOverview) self.codePage = None self.UpdateNotebook(0) finally: wx.EndBusyCursor() def LoadDemoSource(self): self.codePage = None self.codePage = DemoCodePanel(self.nb, self) self.codePage.LoadDemo(self.demoModules) def RunModule(self): """Runs the active module""" module = self.demoModules.GetActive() self.ShutdownDemoModule() overviewText = "" if module is not None: wx.LogMessage("Running demo module...") if hasattr(module, "overview"): overviewText = module.overview wx.YieldIfNeeded() try: self.demoPage = module.runTest(self, self.nb, self) if self.demoPage is None: self.demoPage = ReloadDemoPanel(self.nb, self.codePage, self) except: self.demoPage = DemoErrorPanel(self.nb, self.codePage, DemoError(sys.exc_info()), self) else: self.demoPage = DemoErrorPanel(self.nb, self.codePage, self.demoModules.GetErrorInfo(), self) self.SetOverview(self.demoModules.name + " Overview", overviewText) self.UpdateNotebook() def ShutdownDemoModule(self): if self.demoPage: | def OnSelChanged(self, event): if self.dying: return | 08ecc92023f15aaa5695a616f9712c980650c7c7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/08ecc92023f15aaa5695a616f9712c980650c7c7/Main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
1877,
5033,
12,
2890,
16,
871,
4672,
309,
365,
18,
72,
14946,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
1877,
5033,
12,
2890,
16,
871,
4672,
309,
365,
18,
72,
14946,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
for epoint in iter_entry_points("deprecated_wralea"): self.deprecated_pkg.add(epoint.name.lower()) | def set_search_path(self): """ Define the default wralea search path For that, we look for "wralea" entry points and deprecated_wralea entry point if a package is declared as deprecated_wralea, the module is not load """ self.wraleapath = set() self.deprecated_pkg = set() | 290d1293832ce1e5e6d267820946d45a0efe25a1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11338/290d1293832ce1e5e6d267820946d45a0efe25a1/pkgmanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
3072,
67,
803,
12,
2890,
4672,
3536,
13184,
326,
805,
12408,
5349,
69,
1623,
589,
2457,
716,
16,
732,
2324,
364,
315,
91,
86,
5349,
69,
6,
1241,
3143,
471,
6849,
67,
91,
86,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
3072,
67,
803,
12,
2890,
4672,
3536,
13184,
326,
805,
12408,
5349,
69,
1623,
589,
2457,
716,
16,
732,
2324,
364,
315,
91,
86,
5349,
69,
6,
1241,
3143,
471,
6849,
67,
91,
86,... | |
class ZEOStorage: """Proxy to underlying storage for a single remote client.""" ClientStorageStubClass = ClientStub.ClientStorage def __init__(self, server, read_only=0): self.server = server self.timeout = None self.connection = None self.client = None self.storage = None self.storage_id = "uninitialized" self.transaction = None self.read_only = read_only self.locked = 0 self.log_label = _label def notifyConnected(self, conn): self.connection = conn self.client = self.ClientStorageStubClass(conn) addr = conn.addr if isinstance(addr, type("")): label = addr else: host, port = addr label = str(host) + ":" + str(port) self.log_label = _label + "/" + label def notifyDisconnected(self): if self.transaction is not None: self.log("disconnected during transaction %s" % self.transaction) self._abort() else: self.log("disconnected") def __repr__(self): tid = self.transaction and repr(self.transaction.id) if self.storage: stid = (self.storage._transaction and repr(self.storage._transaction.id)) else: stid = None name = self.__class__.__name__ return "<%s %X trans=%s s_trans=%s>" % (name, id(self), tid, stid) def log(self, msg, level=zLOG.INFO, error=None): zLOG.LOG(self.log_label, level, msg, error=error) def setup_delegation(self): """Delegate several methods to the storage""" self.versionEmpty = self.storage.versionEmpty self.versions = self.storage.versions self.history = self.storage.history self.load = self.storage.load self.loadSerial = self.storage.loadSerial self.modifiedInVersion = self.storage.modifiedInVersion try: fn = self.storage.getExtensionMethods except AttributeError: pass else: for name in fn().keys(): if not hasattr(self,name): setattr(self, name, getattr(self.storage, name)) self.lastTransaction = self.storage.lastTransaction def check_tid(self, tid, exc=None): if self.read_only: raise ReadOnlyError() caller = sys._getframe().f_back.f_code.co_name if self.transaction is None: self.log("no current transaction: %s()" % caller, zLOG.PROBLEM) if exc is not None: raise exc(None, tid) else: return 0 if self.transaction.id != tid: self.log("%s(%s) invalid; current transaction = %s" % (caller, repr(tid), repr(self.transaction.id)), zLOG.PROBLEM) if exc is not None: raise exc(self.transaction.id, tid) else: return 0 return 1 def register(self, storage_id, read_only): """Select the storage that this client will use This method must be the first one called by the client. """ if self.storage is not None: self.log("duplicate register() call") raise ValueError, "duplicate register() call" storage = self.server.storages.get(storage_id) if storage is None: self.log("unknown storage_id: %s" % storage_id) raise ValueError, "unknown storage: %s" % storage_id if not read_only and (self.read_only or storage.isReadOnly()): raise ReadOnlyError() self.read_only = self.read_only or read_only self.storage_id = storage_id self.storage = storage self.setup_delegation() self.timeout = self.server.register_connection(storage_id, self) def get_info(self): return {'length': len(self.storage), 'size': self.storage.getSize(), 'name': self.storage.getName(), 'supportsUndo': self.storage.supportsUndo(), 'supportsVersions': self.storage.supportsVersions(), 'supportsTransactionalUndo': self.storage.supportsTransactionalUndo(), 'extensionMethods': self.getExtensionMethods(), } def get_size_info(self): return {'length': len(self.storage), 'size': self.storage.getSize(), } def getExtensionMethods(self): try: e = self.storage.getExtensionMethods except AttributeError: return {} else: return e() def zeoLoad(self, oid): v = self.storage.modifiedInVersion(oid) if v: pv, sv = self.storage.load(oid, v) else: pv = sv = None try: p, s = self.storage.load(oid, '') except KeyError: if sv: p = s = None else: raise return p, s, v, pv, sv def getInvalidations(self, tid): invtid, invlist = self.server.get_invalidations(tid) if invtid is None: return None self.log("Return %d invalidations up to tid %s" % (len(invlist), u64(invtid))) return invtid, invlist def zeoVerify(self, oid, s, sv): try: os = self.storage.getSerial(oid) except KeyError: self.client.invalidateVerify((oid, '')) else: if sv: if sv != os: self.client.invalidateVerify((oid, '')) else: if s != os: self.client.invalidateVerify((oid, '')) def endZeoVerify(self): self.client.endVerify() def pack(self, time, wait=1): if wait: return run_in_thread(self._pack_impl, time) else: t = threading.Thread(target=self._pack_impl, args=(time,)) t.start() return None def _pack_impl(self, time): self.log("pack(time=%s) started..." % repr(time)) self.storage.pack(time, referencesf) self.log("pack(time=%s) complete" % repr(time)) self.server.invalidate(0, self.storage_id, None, (), self.get_size_info()) def new_oids(self, n=100): """Return a sequence of n new oids, where n defaults to 100""" if self.read_only: raise ReadOnlyError() if n <= 0: n = 1 return [self.storage.new_oid() for i in range(n)] def undo(self, transaction_id): if self.read_only: raise ReadOnlyError() oids = self.storage.undo(transaction_id) if oids: self.server.invalidate(self, self.storage_id, None, map(lambda oid: (oid, ''), oids)) return oids return () def undoInfo(self, first, last, spec): return run_in_thread(self.storage.undoInfo, first, last, spec) def undoLog(self, first, last): return run_in_thread(self.storage.undoLog, first, last) def tpc_begin(self, id, user, description, ext, tid, status): if self.read_only: raise ReadOnlyError() if self.transaction is not None: if self.transaction.id == id: self.log("duplicate tpc_begin(%s)" % repr(id)) return else: raise StorageTransactionError("Multiple simultaneous tpc_begin" " requests from one client.") self.transaction = t = Transaction() t.id = id t.user = user t.description = description t._extension = ext self.serials = [] self.invalidated = [] self.txnlog = CommitLog() self.tid = tid self.status = status def tpc_finish(self, id): if not self.check_tid(id): return assert self.locked self.storage.tpc_finish(self.transaction) tid = self.storage.lastTransaction() if self.invalidated: self.server.invalidate(self, self.storage_id, tid, self.invalidated, self.get_size_info()) self.transaction = None self.locked = 0 self.timeout.end(self) self._handle_waiting() return tid def tpc_abort(self, id): if not self.check_tid(id): return if self.locked: self.storage.tpc_abort(self.transaction) self.transaction = None self.locked = 0 self.timeout.end(self) self._handle_waiting() def _abort(self): if not self.locked: waiting = self.storage._waiting for i in range(len(waiting)): d, z = waiting[i] if z is self: del waiting[i] self.log("Closed connection removed from waiting list." " Clients waiting: %d." % len(waiting)) break if self.transaction: self.tpc_abort(self.transaction.id) def storea(self, oid, serial, data, version, id): self.check_tid(id, exc=StorageTransactionError) self.txnlog.store(oid, serial, data, version) def vote(self, id): self.check_tid(id, exc=StorageTransactionError) if self.locked: return self._vote() else: return self._wait(lambda: self._vote()) def abortVersion(self, src, id): self.check_tid(id, exc=StorageTransactionError) if self.locked: return self._abortVersion(src) else: return self._wait(lambda: self._abortVersion(src)) def commitVersion(self, src, dest, id): self.check_tid(id, exc=StorageTransactionError) if self.locked: return self._commitVersion(src, dest) else: return self._wait(lambda: self._commitVersion(src, dest)) def transactionalUndo(self, trans_id, id): self.check_tid(id, exc=StorageTransactionError) if self.locked: return self._transactionalUndo(trans_id) else: return self._wait(lambda: self._transactionalUndo(trans_id)) def _tpc_begin(self, txn, tid, status): self.locked = 1 self.storage.tpc_begin(txn, tid, status) self.timeout.begin(self) def _store(self, oid, serial, data, version): try: newserial = self.storage.store(oid, serial, data, version, self.transaction) except (SystemExit, KeyboardInterrupt): raise except Exception, err: if not isinstance(err, TransactionError): exc_info = sys.exc_info() self.log("store error: %s, %s" % exc_info[:2], zLOG.ERROR, error=exc_info) del exc_info pickler = cPickle.Pickler() pickler.fast = 1 try: pickler.dump(err, 1) except: msg = "Couldn't pickle storage exception: %s" % repr(err) self.log(msg, zLOG.ERROR) err = StorageServerError(msg) newserial = err else: if serial != "\0\0\0\0\0\0\0\0": self.invalidated.append((oid, version)) self.serials.append((oid, newserial)) def _vote(self): self.client.serialnos(self.serials) return self.storage.tpc_vote(self.transaction) def _abortVersion(self, src): oids = self.storage.abortVersion(src, self.transaction) inv = [(oid, src) for oid in oids] self.invalidated.extend(inv) return oids def _commitVersion(self, src, dest): oids = self.storage.commitVersion(src, dest, self.transaction) inv = [(oid, dest) for oid in oids] self.invalidated.extend(inv) if dest: inv = [(oid, src) for oid in oids] self.invalidated.extend(inv) return oids def _transactionalUndo(self, trans_id): oids = self.storage.transactionalUndo(trans_id, self.transaction) inv = [(oid, None) for oid in oids] self.invalidated.extend(inv) return oids def _wait(self, thunk): self._thunk = thunk if self.storage._transaction: d = Delay() self.storage._waiting.append((d, self)) self.log("Transaction blocked waiting for storage. " "Clients waiting: %d." % len(self.storage._waiting)) return d else: self.log("Transaction acquired storage lock.", zLOG.BLATHER) return self._restart() def _restart(self, delay=None): self._tpc_begin(self.transaction, self.tid, self.status) loads, loader = self.txnlog.get_loader() for i in range(loads): self._store(*loader.load()) resp = self._thunk() if delay is not None: delay.reply(resp) else: return resp def _handle_waiting(self): while self.storage._waiting: delay, zeo_storage = self.storage._waiting.pop(0) if self._restart_other(zeo_storage, delay): if self.storage._waiting: n = len(self.storage._waiting) self.log("Blocked transaction restarted. " "Clients waiting: %d" % n) else: self.log("Blocked transaction restarted.") return def _restart_other(self, zeo_storage, delay): try: zeo_storage._restart(delay) except: self.log("Unexpected error handling waiting transaction", level=zLOG.WARNING, error=sys.exc_info()) zeo_storage.connection.close() return 0 else: return 1 | def close_conn(self, conn): """Internal: remove the given connection from self.connections. | 32bc881f308a45b6dbdcbdfecc2c1005801a356b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/32bc881f308a45b6dbdcbdfecc2c1005801a356b/StorageServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
4646,
12,
2890,
16,
1487,
4672,
3536,
3061,
30,
1206,
326,
864,
1459,
628,
365,
18,
13313,
18,
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,
1746,
67,
4646,
12,
2890,
16,
1487,
4672,
3536,
3061,
30,
1206,
326,
864,
1459,
628,
365,
18,
13313,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.imageview = gtk.Image() self.layout.add(self.imageview) self.statusbar = gtk.Statusbar() self.statusbar.set_has_resize_grip(True) vbox.pack_start(self.statusbar, False, False, 0) self.statusbar.set_property('visible', self.statusbar_show) self.window.add(vbox) self.window.set_property('allow-shrink', False) self.window.set_default_size(width,height) | self.imageview = gtk.Image() self.layout.add(self.imageview) self.statusbar = gtk.Statusbar() self.statusbar.set_has_resize_grip(True) vbox.pack_start(self.statusbar, False, False, 0) self.statusbar.set_property('visible', self.statusbar_show) self.window.add(vbox) self.window.set_property('allow-shrink', False) self.window.set_default_size(width,height) | def __init__(self): | a4d6024d09d807bd2a142bf54daca1a7d1873c7f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/a4d6024d09d807bd2a142bf54daca1a7d1873c7f/mirage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
""" Takes a binary branch and returns its associated source branch. (any trailing version info is left untouched). If source is branched off of <repo1>-2 into <repo2>, its new version will be <repo1>-2/<repo2>/2. The corresponding build will be on branch <repo1>-2-0/<repo2>/2-1. getSourceBranch converts from the latter to the former. Always returns a copy of the branch, even when the two are equal. | """ Takes a binary version and returns its associated source version (any trailing version info is left untouched). If source is branched off of <repo1>-2 into <repo2>, its new version will be <repo1>-2/<repo2>/2. The corresponding build will be on branch <repo1>-2-0/<repo2>/2-1. getSourceBranch converts from the latter to the former. Always returns a copy of the version, even when the two are equal. | def getSourceBranch(self): """ Takes a binary branch and returns its associated source branch. (any trailing version info is left untouched). If source is branched off of <repo1>-2 into <repo2>, its new version will be <repo1>-2/<repo2>/2. The corresponding build will be on branch <repo1>-2-0/<repo2>/2-1. getSourceBranch converts from the latter to the former. Always returns a copy of the branch, even when the two are equal. """ v = self.copy() p = v.branch() | c5625da214694d3138361a3c77d3281b958a841b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/c5625da214694d3138361a3c77d3281b958a841b/versions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7889,
7108,
12,
2890,
4672,
3536,
23004,
279,
3112,
1177,
471,
1135,
2097,
3627,
1084,
1177,
261,
2273,
7341,
1177,
1123,
353,
2002,
640,
869,
19370,
2934,
225,
971,
1084,
353,
324,
2450,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7889,
7108,
12,
2890,
4672,
3536,
23004,
279,
3112,
1177,
471,
1135,
2097,
3627,
1084,
1177,
261,
2273,
7341,
1177,
1123,
353,
2002,
640,
869,
19370,
2934,
225,
971,
1084,
353,
324,
2450,
... |
this = apply(_quickfix.new_NoAltMDSource, args) | this = _quickfix.new_NoAltMDSource(*args) | def __init__(self, *args): this = apply(_quickfix.new_NoAltMDSource, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
2279,
10655,
6188,
1830,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
2279,
10655,
6188,
1830,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,... |
TixSubWidget.__init__(self, master, name, destroy_physically) | TixSubWidget.__init__(self, master, name, destroy_physically) | def __init__(self, master, name, destroy_physically=0): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
16,
508,
16,
5546,
67,
844,
1900,
6478,
33,
20,
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,
... | [
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
4171,
16,
508,
16,
5546,
67,
844,
1900,
6478,
33,
20,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
magic = unpack('<i', buf[:4])[0] & MASK | magic = unpack('<I', buf[:4])[0] | def _parse(self, fp): """Override this method to support alternative .mo formats.""" # We need to & all 32 bit unsigned integers with 0xffffffff for # portability to 64 bit machines. MASK = 0xffffffff unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endian 32 # bit words. self._catalog = catalog = {} buf = fp.read() buflen = len(buf) # Are we big endian or little endian? magic = unpack('<i', buf[:4])[0] & MASK if magic == self.LE_MAGIC: version, msgcount, masteridx, transidx = unpack('<4i', buf[4:20]) ii = '<ii' elif magic == self.BE_MAGIC: version, msgcount, masteridx, transidx = unpack('>4i', buf[4:20]) ii = '>ii' else: raise IOError(0, 'Bad magic number', filename) # more unsigned ints msgcount &= MASK masteridx &= MASK transidx &= MASK # Now put all messages from the .mo file buffer into the catalog # dictionary. for i in xrange(0, msgcount): mlen, moff = unpack(ii, buf[masteridx:masteridx+8]) moff &= MASK mend = moff + (mlen & MASK) tlen, toff = unpack(ii, buf[transidx:transidx+8]) toff &= MASK tend = toff + (tlen & MASK) if mend < buflen and tend < buflen: tmsg = buf[toff:tend] catalog[buf[moff:mend]] = tmsg else: raise IOError(0, 'File is corrupt', filename) # See if we're looking at GNU .mo conventions for metadata if mlen == 0 and tmsg.lower().startswith('project-id-version:'): # Catalog description for item in tmsg.split('\n'): item = item.strip() if not item: continue k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v if k == 'content-type': self._charset = v.split('charset=')[1] # advance to next entry in the seek tables masteridx += 8 transidx += 8 | 6627c4faaeb7c84f8e47c11f191c9656045912af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/6627c4faaeb7c84f8e47c11f191c9656045912af/gettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
12,
2890,
16,
4253,
4672,
3536,
6618,
333,
707,
358,
2865,
10355,
263,
8683,
6449,
12123,
468,
1660,
1608,
358,
473,
777,
3847,
2831,
9088,
12321,
598,
374,
28857,
364,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
12,
2890,
16,
4253,
4672,
3536,
6618,
333,
707,
358,
2865,
10355,
263,
8683,
6449,
12123,
468,
1660,
1608,
358,
473,
777,
3847,
2831,
9088,
12321,
598,
374,
28857,
364,
468,
1... |
if not writing or updating: reading = True | if not writing: if updating: writing = True else: reading = True | def open(filename, flag, mode=0777): """open(filename, flag [, mode=0777]) -> fd Open a file (for low level IO). """ reading = flag & O_RDONLY writing = flag & O_WRONLY updating = flag & O_RDWR creating = flag & O_CREAT truncating = flag & O_TRUNC exclusive = flag & O_EXCL sync = flag & O_SYNC appending = flag & O_APPEND if updating and writing: raise OSError(errno.EINVAL, errno.strerror(errno.EINVAL), filename) if not creating and not path.exists(filename): raise OSError(errno.ENOENT, errno.strerror(errno.ENOENT), filename) if not writing or updating: # Default to reading reading = True if truncating and not writing: # Explicitly truncate, writing will truncate anyway FileIO(filename, 'w').close() if exclusive and creating: try: if not File(sys.getPath(filename)).createNewFile(): raise OSError(errno.EEXIST, errno.strerror(errno.EEXIST), filename) except java.io.IOException, ioe: raise OSError(ioe) mode = '%s%s%s%s' % (reading and 'r' or '', (not appending and writing) and 'w' or '', (appending and (writing or updating)) and 'a' or '', updating and '+' or '') if sync and (writing or updating): from java.io import FileNotFoundException, RandomAccessFile try: fchannel = RandomAccessFile(sys.getPath(filename), 'rws').getChannel() except FileNotFoundException, fnfe: if path.isdir(filename): raise OSError(errno.EISDIR, errno.strerror(errno.EISDIR)) raise OSError(errno.ENOENT, errno.strerror(errno.ENOENT), filename) return FileIO(fchannel, mode) return FileIO(filename, mode) | 4fd599228e348069c24e3fe03dcae1cd8c9fe92c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/4fd599228e348069c24e3fe03dcae1cd8c9fe92c/os.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
3459,
16,
2982,
16,
1965,
33,
20,
14509,
4672,
3536,
3190,
12,
3459,
16,
2982,
306,
16,
1965,
33,
20,
14509,
5717,
317,
5194,
225,
3502,
279,
585,
261,
1884,
4587,
1801,
1665... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1696,
12,
3459,
16,
2982,
16,
1965,
33,
20,
14509,
4672,
3536,
3190,
12,
3459,
16,
2982,
306,
16,
1965,
33,
20,
14509,
5717,
317,
5194,
225,
3502,
279,
585,
261,
1884,
4587,
1801,
1665... |
return (for_score - against_score) / max_score * 100 | if max_score > 0: return (for_score - against_score) / max_score * 100 else: return 0.0 | def member_score(self, member): # Find all votes that # 1) This agenda is ascribed to # 2) the member participated in and either voted for or against for_score = AgendaVote.objects.filter(agenda=self,vote__voteaction__member=member,vote__voteaction__type="for").distinct().aggregate(Sum('score'))['score__sum'] or 0 against_score = AgendaVote.objects.filter(agenda=self,vote__voteaction__member=member,vote__voteaction__type="against").distinct().aggregate(Sum('score'))['score__sum'] or 0 max_score = sum([abs(x) for x in self.agendavote_set.values_list('score', flat=True)]) return (for_score - against_score) / max_score * 100 | 4ea3e0289657f924ee8a6bae7b5ed49dff14768b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1866/4ea3e0289657f924ee8a6bae7b5ed49dff14768b/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3140,
67,
6355,
12,
2890,
16,
3140,
4672,
468,
4163,
777,
19588,
716,
468,
282,
404,
13,
1220,
28809,
353,
6972,
1533,
329,
358,
468,
282,
576,
13,
326,
3140,
30891,
690,
316,
471,
334... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3140,
67,
6355,
12,
2890,
16,
3140,
4672,
468,
4163,
777,
19588,
716,
468,
282,
404,
13,
1220,
28809,
353,
6972,
1533,
329,
358,
468,
282,
576,
13,
326,
3140,
30891,
690,
316,
471,
334... |
sage: open('a.txt','w').write('foo\n{{{\na = 10\n}}}') sage: W = nb._import_worksheet_txt('a.txt', 'admin'); W | sage: name = tmp_filename() + '.txt' sage: open(name,'w').write('foo\n{{{\na = 10\n}}}') sage: W = nb._import_worksheet_txt(name, 'admin'); W | def _import_worksheet_txt(self, filename, owner): """ Import a plain text file as a new worksheet. | a3d8c3669cc55612be1b3e44f266282ee23950e0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/a3d8c3669cc55612be1b3e44f266282ee23950e0/notebook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5666,
67,
1252,
8118,
67,
5830,
12,
2890,
16,
1544,
16,
3410,
4672,
3536,
6164,
279,
7351,
977,
585,
487,
279,
394,
13622,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5666,
67,
1252,
8118,
67,
5830,
12,
2890,
16,
1544,
16,
3410,
4672,
3536,
6164,
279,
7351,
977,
585,
487,
279,
394,
13622,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.doStop() | self.stopFactory() | def timeoutFactory(self): log.msg('timed out waiting for DTP connection') if self.deferred: d, self.deferred = self.deferred, None d.errback(defer.TimeoutError()) self.doStop() | 4874c056190d7e4aebcf4133590bb599cc8f79a2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/4874c056190d7e4aebcf4133590bb599cc8f79a2/ftp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2021,
1733,
12,
2890,
4672,
613,
18,
3576,
2668,
20905,
596,
7336,
364,
10696,
52,
1459,
6134,
309,
365,
18,
26622,
30,
302,
16,
365,
18,
26622,
273,
365,
18,
26622,
16,
599,
302,
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,
2021,
1733,
12,
2890,
4672,
613,
18,
3576,
2668,
20905,
596,
7336,
364,
10696,
52,
1459,
6134,
309,
365,
18,
26622,
30,
302,
16,
365,
18,
26622,
273,
365,
18,
26622,
16,
599,
302,
18,
... |
if not token.has_key("inserted") or not token["inserted"]: | if "inserted" not in token or not token["inserted"]: | def next (self, item=None, after=False): length = len(self.tokens) self.eolBefore = False self.breakBefore = False | bd9ed2c17d104bb179792ba3d49e42faf3be4343 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5718/bd9ed2c17d104bb179792ba3d49e42faf3be4343/treegenerator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
261,
2890,
16,
761,
33,
7036,
16,
1839,
33,
8381,
4672,
769,
273,
562,
12,
2890,
18,
7860,
13,
365,
18,
30951,
4649,
273,
1083,
365,
18,
8820,
4649,
273,
1083,
2,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1024,
261,
2890,
16,
761,
33,
7036,
16,
1839,
33,
8381,
4672,
769,
273,
562,
12,
2890,
18,
7860,
13,
365,
18,
30951,
4649,
273,
1083,
365,
18,
8820,
4649,
273,
1083,
2,
-100,
-100,
-... |
'target':'new', | 'target': 'new', | def action_cancel(self,cr,uid,ids,conect=None): return { 'view_type': 'form', "view_mode": 'form', 'res_model': 'ir.actions.configuration.wizard', 'type': 'ir.actions.act_window', 'target':'new', } | 7f170d648ce806a9582087e82434ea26e4f2d585 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/7f170d648ce806a9582087e82434ea26e4f2d585/crm_config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
10996,
12,
2890,
16,
3353,
16,
1911,
16,
2232,
16,
591,
386,
33,
7036,
4672,
327,
288,
296,
1945,
67,
723,
4278,
296,
687,
2187,
315,
1945,
67,
3188,
6877,
296,
687,
2187,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1301,
67,
10996,
12,
2890,
16,
3353,
16,
1911,
16,
2232,
16,
591,
386,
33,
7036,
4672,
327,
288,
296,
1945,
67,
723,
4278,
296,
687,
2187,
315,
1945,
67,
3188,
6877,
296,
687,
2187,
... |
return ".".join(result)+trailing_dot, len(input) | return b".".join(result)+trailing_dot, len(input) | def encode(self,input,errors='strict'): | cc8c2fe72be08080ce95434d60e82e08cbffb739 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/cc8c2fe72be08080ce95434d60e82e08cbffb739/idna.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
2630,
16,
4324,
2218,
13948,
11,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2017,
12,
2890,
16,
2630,
16,
4324,
2218,
13948,
11,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._job.lock_status = None | def NotifyStart(self): """Mark the opcode as running, not lock-waiting. | 9bdab6219839d70dcea52ad9ffa3b4b449794854 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7542/9bdab6219839d70dcea52ad9ffa3b4b449794854/jqueue.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10918,
1685,
12,
2890,
4672,
3536,
3882,
326,
11396,
487,
3549,
16,
486,
2176,
17,
20241,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10918,
1685,
12,
2890,
4672,
3536,
3882,
326,
11396,
487,
3549,
16,
486,
2176,
17,
20241,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
print "ARRRRRGHs", args | print "opt", options print "arg", args | def parse_comand_line(): """ Handle command line arguments. """ parser = OptionParser() # Add comand line option debug(-d or --debug) to print all pubsub message is # being sent parser.add_option("-d", "--debug", action="store_true", dest="debug") parser.add_option("-i", "--import", action="store", dest="dicom_dir") options, args = parser.parse_args() print "ARRRRRGHs", args if options.debug: # The user passed the debug option? # Yes! # Then all pubsub message must be printed. ps.Publisher().subscribe(print_events, ps.ALL_TOPICS) session = Session() session.debug = 1 elif options.dicom_dir: # The user passed directory to me? import_dir = options.dicom_dir ps.Publisher().sendMessage('Import directory', import_dir) #print "Hey, guy you must pass a directory to me!" #else: # print "Hey, guy, you need to pass a inv3 file to me!" # Check if there is a file path somewhere in what the user wrote i = len(args) while i: i -= 1 file = args[i] if os.path.isfile(file): path = os.path.abspath(file) ps.Publisher().sendMessage('Open project', path) i = 0 | 848b9e313983559afcf6a0e295e34676fb129c0b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10228/848b9e313983559afcf6a0e295e34676fb129c0b/invesalius.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
832,
464,
67,
1369,
13332,
3536,
5004,
1296,
980,
1775,
18,
3536,
2082,
273,
18862,
1435,
225,
468,
1436,
532,
464,
980,
1456,
1198,
19236,
72,
578,
1493,
4148,
13,
358,
1172,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
832,
464,
67,
1369,
13332,
3536,
5004,
1296,
980,
1775,
18,
3536,
2082,
273,
18862,
1435,
225,
468,
1436,
532,
464,
980,
1456,
1198,
19236,
72,
578,
1493,
4148,
13,
358,
1172,
... |
selection = maSelector( loci=range(numDSL), fitness=selCoef, wildtype=[1] ) | selection = maSelector( loci=range(numDSL), fitness=selCoef, wildtype=[0] ) | def simuCDCV( numDSL, initSpec, selModel, selModelAllDSL, selCoef, mutaModel, maxAllele, mutaRate, initSize, finalSize, burnin, noMigrGen, mixingGen, growth, numSubPop, migrModel, migrRate, update, dispPlot, saveAt, savePop, resume, resumeAtGen, name, dryrun): ''' parameters are self-expanary. See help info for detailed simulation scheme. ''' # generations mixing = burnin + noMigrGen end = mixing + mixingGen # pop size if growth == 'linear': incFunc = LinearExpansion(initSize, finalSize, end, burnin, burnin, numSubPop) elif growth == 'exponential': incFunc = ExponentialExpansion(initSize, finalSize, end, burnin, burnin, numSubPop) elif growth == 'instant': incFunc = InstantExpansion(initSize, finalSize, end, burnin, burnin, numSubPop) # # create a simulator, if not in resume mode if resume == '': simu = simulator( population(subPop=incFunc(0), loci=[1]*(numDSL), maxAllele = maxAllele, infoFields=['fitness']), randomMating(newSubPopSizeFunc=incFunc) ) else: try: print "Resuming simulation from file ", resume, " at generation ", resumeAtGen pop = LoadPopulation(resume) simu = simulator(pop, randomMating(newSubPopSizeFunc=incFunc)) simu.setGen(resumeAtGen) except exceptions.Exception, e: print "Can not resume from population "+ resume + ". Aborting." raise e # determine mutation etc if mutaModel == 'k-allele': mutation = kamMutator(rate=mutaRate, atLoci=range(numDSL), maxAllele=maxAllele) else: mutation = smmMutator(rate=mutaRate, atLoci=range(numDSL), maxAllele=maxAllele) # determine selection # if selModelAllDSL == 'customized': selection = maSelector( loci=range(numDSL), fitness=selCoef, wildtype=[1] ) else: sel = [] for d in range(numDSL): if selModel[d] == 'recessive': sel.append( maSelector(locus=d, fitness=[1,1,1-selCoef[d]], wildtype=[1])) else: sel.append( maSelector(locus=d, fitness=[1,1-selCoef[d]/2.,1-selCoef[d]], wildtype=[1])) # now, the whole selector if selModelAllDSL == 'additive': selection = mlSelector( sel, mode=SEL_Additive) elif selModelAllDSL == 'multiplicative': selection = mlSelector( sel, mode=SEL_Multiplicative) # migration if numSubPop == 1 or migrModel == 'none': # no migration migration = noneOp() else: if migrModel == 'island': migration = migrator(migrIslandRates(migrRate, numSubPop), begin=mixing) else: migration = migrator(migrStepstoneRates(migrRate, numSubPop, circular=True), begin=mixing) # # prepare log file, if not in resume mode if resume == '': # not resume logOutput = open(os.path.join(name, name+'.log'), 'w') logOutput.write("gen\t") for d in range(numDSL): logOutput.write( 'ne\tn\tf0\tp1\tp5\tanc\t') logOutput.write("\n") logOutput.close() # use global global allelesBeforeExpansion allelesBeforeExpansion = [] global NeHist, NeMax, FHist, FMax # determine plot label plotLabel = [] for i in range(numDSL): if selModelAllDSL == 'customized': plotLabel.append('mu=%g, s=customized' % mutaRate[i]) else: plotLabel.append('mu=%g, s=%g' % (mutaRate[i], selCoef[i])) # history of Ne, the first one is gen NeHist = [] FHist = [] for i in range(numDSL+1): NeHist.append( [] ) FHist.append( [] ) NeMax = 0 FMax = 0 # start evolution simu.evolve( # start evolution preOps= # initialize DSL [initByFreq(atLoci=[x], alleleFreq=initSpec[x]) for x in range(numDSL)], ops=[ # report population size, for monitoring purpose only # count allele frequencies at both loci stat(popSize=True, alleleFreq=range(numDSL)), # report generation and popsize pyEval(r"'%d\t%d\n' % (gen, popSize)", step=50), # # record alleles before expansion, used to count percentage of alleles derived # from before expansion. pyExec('global allelesBeforeExpansion\n'+ '''for i in range(%d): allelesBeforeExpansion.append([]) for a in range(2,len(alleleNum[i])): if alleleNum[i][a] != 0: allelesBeforeExpansion[i].append(a) print "Ancestral alleles before expansion: ", allelesBeforeExpansion[i]''' % \ (numDSL), at=[burnin]), # splitSubPop(0, proportions=[1./numSubPop]*numSubPop, at=[burnin]), # mutate mutation, # selection selection, # migration migration, # visualizer pyOperator(func=PlotSpectra, param=(numDSL, saveAt, 50, dispPlot, plotLabel, name), step=update ), # pause when needed #pause(stopOnKeyStroke=True), # monitor execution time ticToc(step=100), ## pause at any user key input (for presentation purpose) ## pause(stopOnKeyStroke=1) ], end=end, dryrun = dryrun ) # if savePop != '': simu.population(0).savePopulation(savePop) | ed7f5913f23271d4c22dbdf8629493f8e56e689e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/401/ed7f5913f23271d4c22dbdf8629493f8e56e689e/simuCDCV.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3142,
89,
39,
5528,
58,
12,
818,
29387,
16,
1208,
1990,
16,
357,
1488,
16,
357,
1488,
1595,
29387,
16,
357,
4249,
10241,
16,
4318,
69,
1488,
16,
943,
1595,
6516,
16,
4318,
69,
4727,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3142,
89,
39,
5528,
58,
12,
818,
29387,
16,
1208,
1990,
16,
357,
1488,
16,
357,
1488,
1595,
29387,
16,
357,
4249,
10241,
16,
4318,
69,
1488,
16,
943,
1595,
6516,
16,
4318,
69,
4727,
... |
cls = [] | cls = [] | def __call__(self, attr, data): if data.domain[attr].varType == orange.VarTypes.Discrete: print "S2NMeasureMix can not evaluate discrete attributes" return -1 # if the data changed clear the attribute values if data != self.dataMix: self.attrInfoMix = {} self.attrInfo = {} self.dataMix = data | 26d741f3cc960895833942ba0fa8e057b9e5b3dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/26d741f3cc960895833942ba0fa8e057b9e5b3dd/OWVisAttrSelection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1604,
16,
501,
4672,
309,
501,
18,
4308,
63,
1747,
8009,
1401,
559,
422,
578,
726,
18,
1537,
2016,
18,
1669,
6883,
30,
1172,
315,
55,
22,
50,
7197,
212... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1604,
16,
501,
4672,
309,
501,
18,
4308,
63,
1747,
8009,
1401,
559,
422,
578,
726,
18,
1537,
2016,
18,
1669,
6883,
30,
1172,
315,
55,
22,
50,
7197,
212... |
if type(module) == type(''): | if isinstance(module, basestring): | def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=TextTestRunner, testLoader=defaultTestLoader): if type(module) == type(''): self.module = __import__(module) for part in module.split('.')[1:]: self.module = getattr(self.module, part) else: self.module = module if argv is None: argv = sys.argv self.verbosity = 1 self.defaultTest = defaultTest self.testRunner = testRunner self.testLoader = testLoader self.progName = os.path.basename(argv[0]) self.parseArgs(argv) self.runTests() | 53a23f492fdb323f97d2bed8feb3634ca3947266 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/53a23f492fdb323f97d2bed8feb3634ca3947266/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1605,
2218,
972,
5254,
972,
2187,
805,
4709,
33,
7036,
16,
5261,
33,
7036,
16,
1842,
9709,
33,
1528,
4709,
9709,
16,
1842,
2886,
33,
1886,
4709,
2886,
46... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1605,
2218,
972,
5254,
972,
2187,
805,
4709,
33,
7036,
16,
5261,
33,
7036,
16,
1842,
9709,
33,
1528,
4709,
9709,
16,
1842,
2886,
33,
1886,
4709,
2886,
46... |
elif func.name == 'BufferSubData': | elif name == 'BufferSubData': | def WriteServiceImplementation(self, func, file): """Overrriden from TypeHandler.""" file.Write( "parse_error::ParseError GLES2DecoderImpl::Handle%s(\n" % func.name) file.Write( " uint32 immediate_data_size, const gles2::%s& c) {\n" % func.name) for arg in func.GetCmdArgs(): arg.WriteGetCode(file) | 07f54fcc277a2d8fc3e6cecc5df5ea5c3d5ed080 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/07f54fcc277a2d8fc3e6cecc5df5ea5c3d5ed080/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
13621,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
12,
315,
2670,
67,
1636,
2866,
21004,
611,
11386,
22,
7975,
2828,
286... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2598,
1179,
13621,
12,
2890,
16,
1326,
16,
585,
4672,
3536,
22042,
1691,
275,
628,
1412,
1503,
12123,
585,
18,
3067,
12,
315,
2670,
67,
1636,
2866,
21004,
611,
11386,
22,
7975,
2828,
286... |
self.__builddir = tempfile.mkdtemp(dir = self.tmpdir, | self.__builddir = tempfile.mkdtemp(dir = os.path.abspath(self.tmpdir), | def __ensure_builddir(self): if not self.__builddir is None: return | 3e40d4c418ce8a652b269d48e3794bf49c2765e7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9342/3e40d4c418ce8a652b269d48e3794bf49c2765e7/creator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
15735,
67,
70,
89,
330,
449,
481,
12,
2890,
4672,
309,
486,
365,
16186,
70,
89,
330,
449,
481,
353,
599,
30,
327,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
15735,
67,
70,
89,
330,
449,
481,
12,
2890,
4672,
309,
486,
365,
16186,
70,
89,
330,
449,
481,
353,
599,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
gk.set_default_keyring_sync(self.name) | self.gk.set_default_keyring_sync(self.name) | def _setup_keyring(self): # import it here so importing this backend on a non GNOME # system doesn't fails import gnomekeyring as gk self.gk = gk self.name = gk.get_default_keyring_sync() | 0404cd6199442b1dd488de7d10034b92aaf610bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12036/0404cd6199442b1dd488de7d10034b92aaf610bd/nm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8401,
67,
856,
8022,
12,
2890,
4672,
468,
1930,
518,
2674,
1427,
25077,
333,
4221,
603,
279,
1661,
611,
3417,
958,
468,
2619,
3302,
1404,
6684,
1930,
22908,
1742,
856,
8022,
487,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8401,
67,
856,
8022,
12,
2890,
4672,
468,
1930,
518,
2674,
1427,
25077,
333,
4221,
603,
279,
1661,
611,
3417,
958,
468,
2619,
3302,
1404,
6684,
1930,
22908,
1742,
856,
8022,
487,
31... |
if attachment.datas: | if attachment.datas is not False: | def get_data(self, cursor, user, uri, context=None, cache=None): from DAV.errors import DAV_NotFound attachment_obj = self.pool.get('ir.attachment') report_obj = self.pool.get('ir.action.report') | 782bea734dff08258cb10d2b72057ca3bcef560b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/782bea734dff08258cb10d2b72057ca3bcef560b/webdav.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
892,
12,
2890,
16,
3347,
16,
729,
16,
2003,
16,
819,
33,
7036,
16,
1247,
33,
7036,
4672,
628,
463,
5856,
18,
4324,
1930,
463,
5856,
67,
2768,
6042,
67,
2603,
273,
365,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
892,
12,
2890,
16,
3347,
16,
729,
16,
2003,
16,
819,
33,
7036,
16,
1247,
33,
7036,
4672,
628,
463,
5856,
18,
4324,
1930,
463,
5856,
67,
2768,
6042,
67,
2603,
273,
365,
18,
... |
if tools.config['db_password']: logger.notifyChannel("web-service", netsvc.LOG_ERROR, 'RESTORE DB: %s doesn\'t work with password' % (db_name,)) raise Exception, "Couldn't restore database with password" | def restore(self, password, db_name, data): security.check_super(password) logger = netsvc.Logger() | c8f2d23783990c0effac6b09c24a2305e6c155ef /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/c8f2d23783990c0effac6b09c24a2305e6c155ef/web_services.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5217,
12,
2890,
16,
2201,
16,
1319,
67,
529,
16,
501,
4672,
4373,
18,
1893,
67,
9565,
12,
3664,
13,
1194,
273,
21954,
4227,
18,
3328,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5217,
12,
2890,
16,
2201,
16,
1319,
67,
529,
16,
501,
4672,
4373,
18,
1893,
67,
9565,
12,
3664,
13,
1194,
273,
21954,
4227,
18,
3328,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... | |
(error,msgs) = serverStuff.depchecktree(rpms) if error==1: | (error, msgs) = serverStuff.depchecktree(rpms) if error: | def main(): headerdir = 'headers' headerinfo = headerdir + '/' + 'header.info' if len(sys.argv) < 2: serverStuff.Usage() cmds = {} cmds['checkdeps'] = 0 cmds['writehdrs'] = 1 cmds['rpmcheck'] = 0 cmds['compress'] = 1 cmds['loud'] = 0 cmds['quiet'] = 0 cmds['usesymlinks'] = 0 args = sys.argv[1:] basedir = args[-1] del args[-1] for arg in args: if arg == "-v": cmds['loud'] = 1 elif arg == "-d": cmds['checkdeps'] = 1 elif arg == "-n": cmds['writehdrs'] = 0 elif arg == "-c": cmds['rpmcheck'] = 1 elif arg == "-z": cmds['compress'] = 1 elif arg == "-l": cmds['usesymlinks'] = 1 elif arg == "-vv": cmds['loud'] = 1 log.verbosity = 4 elif arg == "-q": cmds['quiet'] = 1 elif arg in ['-h','--help']: serverStuff.Usage() #save where we are right now curdir = os.getcwd() #start the sanity/stupidity checks if not os.path.exists(basedir): print "Directory of rpms must exist" serverStuff.Usage() if not os.path.isdir(basedir): print "Directory of rpms must be a directory." sys.exit(1) #change to the basedir to work from w/i the path - for relative url paths os.chdir(basedir) #get the list of rpms rpms=serverStuff.getfilelist('./', '.rpm', [], cmds['usesymlinks']) #and a few more sanity checks if len(rpms) < 1: print "No rpms to look at. Exiting." sys.exit(1) if cmds['checkdeps']: (error,msgs) = serverStuff.depchecktree(rpms) if error==1: print "Errors within the dir(s):\n %s" % basedir for msg in msgs: print " " + msg sys.exit(1) else: print "All dependencies resolved and no conflicts detected" if cmds['writehdrs']: #if the headerdir exists and its a file then we're in deep crap if os.path.isfile(headerdir): print "%s is a file" % (headerdir) sys.exit(1) #if it doesn't exist then make the dir if not os.path.exists(headerdir): os.mkdir(headerdir) # done with the sanity checks, on to the cleanups #looks for a list of .hdr files and the header.info file hdrlist = serverStuff.getfilelist(headerdir, '.hdr', [], 0) #removes both entirely for hdr in hdrlist: os.unlink(hdr) if os.path.exists(headerinfo): os.unlink(headerinfo) rpminfo = genhdrs(rpms, headerdir, cmds) #Write header.info file print "\nWriting header.info file" headerfd = open(headerinfo, "w") for item in rpminfo.keys(): (name,arch) = item (epoch, ver, rel, rpmloc) = rpminfo[item] info = "%s:%s-%s-%s.%s=%s\n" % (epoch, name, ver, rel, arch, rpmloc) headerfd.write(info) headerfd.close() #take us home mr. data os.chdir(curdir) | bac42c123a9bea85e392cf85037495b83cd3f314 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/bac42c123a9bea85e392cf85037495b83cd3f314/pullheaders.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1446,
1214,
273,
296,
2485,
11,
1446,
1376,
273,
1446,
1214,
397,
2023,
397,
296,
3374,
18,
1376,
11,
309,
225,
562,
12,
9499,
18,
19485,
13,
411,
576,
30,
1438,
510,
3809... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1446,
1214,
273,
296,
2485,
11,
1446,
1376,
273,
1446,
1214,
397,
2023,
397,
296,
3374,
18,
1376,
11,
309,
225,
562,
12,
9499,
18,
19485,
13,
411,
576,
30,
1438,
510,
3809... |
print "er" | def main(restrictionsfn, program, args): global usercontext global usercode global simpleexec # start the nanny up and read the restrictions files. restrictions.init_restrictions(restrictionsfn) # Armon: Update our IP cache emulcomm.update_ip_cache() if logfile: # time to set up the circular logger loggerfo = logging.circular_logger(logfile) # and redirect err and out there... sys.stdout = loggerfo sys.stderr = loggerfo else: # let's make it so that the output (via print) is always flushed sys.stdout = logging.flush_logger(sys.stdout) # grab the user code from the file usercode = file(program).read() # In order to work well with files that may contain a mix of \r\n and \n # characters (see ticket #32), I'm going to replace all \r\n with \n usercode = usercode.replace('\r\n','\n') # If we are in "simple execution" mode, execute and exit if simpleexec: safe.safe_exec(usercode,usercontext) sys.exit(0) # I'll use this to detect when the program is idle so I know when to quit... idlethreadcount = threading.activeCount() # call the initialize function usercontext['callfunc'] = 'initialize' usercontext['callargs'] = args[:] initialize_id = idhelper.getuniqueid() try: nanny.tattle_add_item('events', initialize_id) except Exception, e: print "er" tracebackrepy.handle_internalerror("Failed to aquire event for '" + \ "initialize' event.\n(Exception was: %s)" % e.message, 140) try: safe.safe_exec(usercode,usercontext) except SystemExit: raise except: # I think it makes sense to exit if their code throws an exception... tracebackrepy.handle_exception() nonportable.harshexit(6) finally: nanny.tattle_remove_item('events', initialize_id) # I've changed to the threading library, so this should increase if there are # pending events while threading.activeCount() > idlethreadcount: # do accounting here? time.sleep(1) # Once there are no more pending events for the user thread, we give them # an "exit" event. This allows them to clean up, etc. if needed. # call the user program to notify them that we are exiting... usercontext['callfunc'] = 'exit' usercontext['callargs'] = (None,) exit_id = idhelper.getuniqueid() try: nanny.tattle_add_item('events', exit_id) except Exception, e: print "er" tracebackrepy.handle_internalerror("Failed to aquire event for '" + \ "exit' event.\n(Exception was: %s)" % e.message, 141) try: safe.safe_exec(usercode,usercontext) except SystemExit: raise except: # I think it makes sense to exit if their code throws an exception... tracebackrepy.handle_exception() nonportable.harshexit(7) finally: nanny.tattle_remove_item('events', exit_id) # normal exit... nonportable.harshexit(0) | a7b2e1095194d692d9da6f0fd8b022333fc4e2e6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7272/a7b2e1095194d692d9da6f0fd8b022333fc4e2e6/repy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
23954,
87,
4293,
16,
5402,
16,
833,
4672,
2552,
729,
2472,
2552,
729,
710,
2552,
4143,
4177,
225,
468,
787,
326,
290,
1072,
93,
731,
471,
855,
326,
17499,
1390,
18,
17499,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
23954,
87,
4293,
16,
5402,
16,
833,
4672,
2552,
729,
2472,
2552,
729,
710,
2552,
4143,
4177,
225,
468,
787,
326,
290,
1072,
93,
731,
471,
855,
326,
17499,
1390,
18,
17499,
18... | |
all_machines=vmware_run_command(options,True,("--operation status --vmname '%s'"%(options["-n"])),0) | all_machines=vmware_run_command(options,True,("--operation status --vmname '%s'"%(quote_for_run(options["-n"]))),0) | def vmware_get_outlets_vi(conn, options, add_vm_name): outlets={} if (add_vm_name): all_machines=vmware_run_command(options,True,("--operation status --vmname '%s'"%(options["-n"])),0) else: all_machines=vmware_run_command(options,True,"--operation list",POWER_TIMEOUT) all_machines_array=all_machines.splitlines() for machine in all_machines_array: machine_array=dsv_split(machine) if (len(machine_array)==4): if (machine_array[0] in outlets): fail_usage("Failed. More machines with same name %s found!"%(machine_array[0])) if (vmware_disconnected_hack): outlets[machine_array[0]]=("",( ((machine_array[2].lower() in ["poweredon"]) and (machine_array[3].lower()=="connected")) and "on" or "off")) else: outlets[machine_array[0]]=("",((machine_array[2].lower() in ["poweredon"]) and "on" or "off")) return outlets | fe01865cf8a2f8535c865c4332952863230c2718 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6868/fe01865cf8a2f8535c865c4332952863230c2718/fence_vmware.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4268,
2726,
67,
588,
67,
659,
17307,
67,
522,
12,
4646,
16,
702,
16,
527,
67,
3489,
67,
529,
4672,
596,
17307,
12938,
225,
309,
261,
1289,
67,
3489,
67,
529,
4672,
777,
67,
81,
10635... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4268,
2726,
67,
588,
67,
659,
17307,
67,
522,
12,
4646,
16,
702,
16,
527,
67,
3489,
67,
529,
4672,
596,
17307,
12938,
225,
309,
261,
1289,
67,
3489,
67,
529,
4672,
777,
67,
81,
10635... |
zinfo = zipfile.ZipInfo('content.xml') zfile.writestr(zinfo, self.visitor.content_astext()) | zfile.writestr('content.xml', self.visitor.content_astext()) | def assemble_my_parts(self): """Assemble the `self.parts` dictionary. Extend in subclasses. """ #ipshell('At assemble_parts') writers.Writer.assemble_parts(self) f = tempfile.NamedTemporaryFile() zfile = zipfile.ZipFile(f, 'w', zipfile.ZIP_DEFLATED) zinfo = zipfile.ZipInfo('content.xml') zfile.writestr(zinfo, self.visitor.content_astext()) zfile.writestr('mimetype', MIME_TYPE) s1 = self.create_manifest() zinfo = zipfile.ZipInfo('META-INF/manifest.xml') zfile.writestr(zinfo, s1) s1 = self.create_meta() zinfo = zipfile.ZipInfo('meta.xml') zfile.writestr(zinfo, s1) s1 = self.get_stylesheet() zinfo = zipfile.ZipInfo('styles.xml') zfile.writestr(zinfo, s1) self.store_embedded_files(zfile) zfile.close() f.seek(0) whole = f.read() f.close() self.parts['whole'] = whole self.parts['encoding'] = self.document.settings.output_encoding self.parts['version'] = docutils.__version__ | 57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/57ceb741b8ea9b94d9b9e314a03912d12bd3c5c5/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19540,
67,
4811,
67,
6019,
12,
2890,
4672,
3536,
1463,
10045,
326,
1375,
2890,
18,
6019,
68,
3880,
18,
225,
27686,
316,
15320,
18,
3536,
468,
625,
10304,
2668,
861,
19540,
67,
6019,
6134... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19540,
67,
4811,
67,
6019,
12,
2890,
4672,
3536,
1463,
10045,
326,
1375,
2890,
18,
6019,
68,
3880,
18,
225,
27686,
316,
15320,
18,
3536,
468,
625,
10304,
2668,
861,
19540,
67,
6019,
6134... |
"""Test simple positional mapping pattern matching for cases where patterns match.""" | """Test simple positional mapping pattern matching.""" | def testSimpleMappingMatch(self): """Test simple positional mapping pattern matching for cases where patterns match.""" | bed8265555befdfceb7ec7c667e8d9c4aaa9d2bc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5223/bed8265555befdfceb7ec7c667e8d9c4aaa9d2bc/test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
5784,
3233,
2060,
12,
2890,
4672,
3536,
4709,
4143,
16780,
2874,
1936,
3607,
364,
6088,
1625,
6884,
845,
12123,
2,
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,
1842,
5784,
3233,
2060,
12,
2890,
4672,
3536,
4709,
4143,
16780,
2874,
1936,
3607,
364,
6088,
1625,
6884,
845,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if exe == 'x' and out==None: | if exe == None and out==None: | def leftsize(inp=None, out=None, i=None, verb=False, exe=None): if exe == 'x' and out==None: # invalid combination, fix the call exe = 'g' return __run('sfleftsize', __parse(locals()), inp, out, verb, __x(exe,glob_exe)) | 83e80f2a89de925c7813a3af90f96b32414dd343 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3143/83e80f2a89de925c7813a3af90f96b32414dd343/sf.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2002,
1467,
12,
31647,
33,
7036,
16,
596,
33,
7036,
16,
277,
33,
7036,
16,
6405,
33,
8381,
16,
15073,
33,
7036,
4672,
225,
309,
15073,
422,
599,
471,
596,
631,
7036,
30,
468,
2057,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2002,
1467,
12,
31647,
33,
7036,
16,
596,
33,
7036,
16,
277,
33,
7036,
16,
6405,
33,
8381,
16,
15073,
33,
7036,
4672,
225,
309,
15073,
422,
599,
471,
596,
631,
7036,
30,
468,
2057,
1... |
'work_phone': fields.related('address_id', 'phone', type='char', string='Work Phone', readonly=True), | 'work_phone': fields.related('address_id', 'phone', type='char', size=32, string='Work Phone', readonly=True), | def job_open(self, cr, uid, ids, *args): self.write(cr, uid, ids, {'state': 'open'}) return True | fec76a4931d61d17fe6fb7d96fb30989ddf288a4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/fec76a4931d61d17fe6fb7d96fb30989ddf288a4/hr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1719,
67,
3190,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
380,
1968,
4672,
365,
18,
2626,
12,
3353,
16,
4555,
16,
3258,
16,
13666,
2019,
4278,
296,
3190,
11,
6792,
327,
1053,
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,
1719,
67,
3190,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
380,
1968,
4672,
365,
18,
2626,
12,
3353,
16,
4555,
16,
3258,
16,
13666,
2019,
4278,
296,
3190,
11,
6792,
327,
1053,
2,
-1... |
if pypt_magic.file(os.path.abspath(filename)) == "application/x-bzip2": archive.decompress_the_file(os.path.abspath(filename), target_path, filename, 1) elif pypt_magic.file(os.path.abspath(filename)) == "application/x-gzip": archive.decompress_the_file(os.path.abspath(filename), target_path, filename, 2) elif pypt_magic.file(filename) == "PGP armored data" or pypt_magic.file(filename) == "application/x-dpkg": if os.access(target_path, os.W_OK): shutil.copy(filename, target_path) log.msg("%s file synced.\n" % (filename)) os.unlink(filename) elif response.startswith('n') or response.startswith('N'): log.err("Exiting gracefully on user request.\n\n") | magic_check_and_uncompress(os.path.abspath(filename), target_path, filename) else: log.msg("Exiting gracefully on user request.\n") | def list_bugs(): log.msg("\n\nFollowing are the list of bugs present.\n") for each_bug in bugs_number.keys(): bug_num = each_bug.split('.')[1] bug_subject = bugs_number[each_bug] log.msg("%s\t%s\n" % (bug_num, bug_subject) ) | bf27eda3758a3b77fdeff5b846a63c1c8feb3962 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12499/bf27eda3758a3b77fdeff5b846a63c1c8feb3962/pypt_core.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
19381,
13332,
613,
18,
3576,
31458,
82,
64,
82,
8328,
310,
854,
326,
666,
434,
22398,
3430,
8403,
82,
7923,
364,
1517,
67,
925,
316,
22398,
67,
2696,
18,
2452,
13332,
7934,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
666,
67,
19381,
13332,
613,
18,
3576,
31458,
82,
64,
82,
8328,
310,
854,
326,
666,
434,
22398,
3430,
8403,
82,
7923,
364,
1517,
67,
925,
316,
22398,
67,
2696,
18,
2452,
13332,
7934,
67... |
else | else: | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 537) else quickfix.IntField.__init__(self, 537, 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,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1381,
6418,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
1381,
6418,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
27... |
return self._poly | """ Returns an integer polynomial congruent to this one modulo the precision of each coefficient. NOTE: The lift that is returned will not necessarily be the same for polynomials with the same coefficients (ie same values and precisions): it will depend on how the polynomials are created. EXAMPLES: sage: K = Qp(13,7) sage: R.<t> = K[] sage: a = 13^7*t^3 + K(169,4)*t - 13^4 sage: a.lift() 62748517*t^3 + 169*t - 28561 """ return self.base_ring().prime_pow(self._valbase) * self._poly | def lift(self): return self._poly | 04fbc0922cf1afbc8d5e2f783cea01d23cbba31a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/04fbc0922cf1afbc8d5e2f783cea01d23cbba31a/polynomial_padic_capped_relative_dense.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
28080,
12,
2890,
4672,
327,
365,
6315,
16353,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
28080,
12,
2890,
4672,
327,
365,
6315,
16353,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
site,self.segments[i-1].start,self.segments[i-1].end, site,self.segments[i].start,self.segments[i].end) | site,self.segments[i-1].startpad,self.segments[i-1].endpad, site,self.segments[i].startpad,self.segments[i].endpad) | def builddag(self,cache,bank,inspiral): chan = self.config['input']['channel-name'] site = chan[0] ifo = chan[0:2] dag_fh = open( self.basename + ".dag", "w" ) print >> dag_fh, "DOT %s.dot UPDATE OVERWRITE" % self.basename # jobs to generate the frame cache files for seg in self.segments: jobname = 'frcache_%s_%d_%d' % (site,seg.start,seg.end) print >> dag_fh, 'JOB %s %s.frcache.condor' % (jobname,self.basename), if not cache: print >> dag_fh, 'done', print >> dag_fh, '\nVARS %s site="%s"' % (jobname,site) print >> dag_fh, 'VARS %s frstart="%s"' % (jobname,seg.start) print >> dag_fh, 'VARS %s frend="%s"' % (jobname,seg.end) for i in range(1,len(self.segments)): print >> dag_fh, 'PARENT frcache_%s_%s_%s CHILD frcache_%s_%s_%s' % ( site,self.segments[i-1].start,self.segments[i-1].end, site,self.segments[i].start,self.segments[i].end) # jobs to generate the template banks for seg in self.segments: parent = 'frcache_%s_%s_%s' % (site,seg.start,seg.end) for chunk in seg.chunks: jobname = 'tmpltbank_%s_%s_%s' % (ifo,chunk.start,chunk.end) print >> dag_fh, 'JOB %s %s.tmpltbank.condor' % (jobname,self.basename), if not cache: print >> dag_fh, 'done', print >> dag_fh, '\nVARS %s site="%s"' % (jobname,site) print >> dag_fh, 'VARS %s ifo="%s"' % (jobname,ifo) print >> dag_fh, 'VARS %s frstart="%s"' % (jobname,seg.start) print >> dag_fh, 'VARS %s frend="%s"' % (jobname,seg.end) print >> dag_fh, 'VARS %s start="%d"' % (jobname,chunk.start) print >> dag_fh, 'VARS %s end="%d"' % (jobname,chunk.end) print >> dag_fh, 'VARS %s channel="%s"' % (jobname,chan) print >> dag_fh, 'VARS %s calcache="%s"' % (jobname, self.config['input'][string.lower(ifo) + '-cal']) print >> dag_fh, 'PARENT %s CHILD %s' % (parent, jobname) | 3c2fb825ff922c2b65b4acdd1b8d1a4fa751c5e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/3c2fb825ff922c2b65b4acdd1b8d1a4fa751c5e5/inspiral_pipeline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25666,
330,
449,
346,
12,
2890,
16,
2493,
16,
10546,
16,
267,
1752,
481,
287,
4672,
3861,
273,
365,
18,
1425,
3292,
2630,
21712,
4327,
17,
529,
3546,
2834,
273,
3861,
63,
20,
65,
21479... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25666,
330,
449,
346,
12,
2890,
16,
2493,
16,
10546,
16,
267,
1752,
481,
287,
4672,
3861,
273,
365,
18,
1425,
3292,
2630,
21712,
4327,
17,
529,
3546,
2834,
273,
3861,
63,
20,
65,
21479... |
def gettext(self, message): missing = object() tmsg = self._catalog.get(message, missing) if tmsg is missing: if self._fallback: return self._fallback.gettext(message) return message if self._output_charset: return tmsg.encode(self._output_charset) elif self._charset: return tmsg.encode(self._charset) return tmsg | def _parse(self, fp): """Override this method to support alternative .mo formats.""" unpack = struct.unpack filename = getattr(fp, 'name', '') # Parse the .mo file header, which consists of 5 little endian 32 # bit words. self._catalog = catalog = {} self.plural = lambda n: int(n != 1) # germanic plural by default buf = fp.read() buflen = len(buf) # Are we big endian or little endian? magic = unpack('<I', buf[:4])[0] if magic == self.LE_MAGIC: version, msgcount, masteridx, transidx = unpack('<4I', buf[4:20]) ii = '<II' elif magic == self.BE_MAGIC: version, msgcount, masteridx, transidx = unpack('>4I', buf[4:20]) ii = '>II' else: raise IOError(0, 'Bad magic number', filename) # Now put all messages from the .mo file buffer into the catalog # dictionary. for i in range(0, msgcount): mlen, moff = unpack(ii, buf[masteridx:masteridx+8]) mend = moff + mlen tlen, toff = unpack(ii, buf[transidx:transidx+8]) tend = toff + tlen if mend < buflen and tend < buflen: msg = buf[moff:mend] tmsg = buf[toff:tend] else: raise IOError(0, 'File is corrupt', filename) # See if we're looking at GNU .mo conventions for metadata if mlen == 0: # Catalog description lastk = k = None for item in tmsg.splitlines(): item = item.strip() if not item: continue if ':' in item: k, v = item.split(':', 1) k = k.strip().lower() v = v.strip() self._info[k] = v lastk = k elif lastk: self._info[lastk] += '\n' + item if k == 'content-type': self._charset = v.split('charset=')[1] elif k == 'plural-forms': v = v.split(';') plural = v[1].split('plural=')[1] self.plural = c2py(plural) # Note: we unconditionally convert both msgids and msgstrs to # Unicode using the character encoding specified in the charset # parameter of the Content-Type header. The gettext documentation # strongly encourages msgids to be us-ascii, but some appliations # require alternative encodings (e.g. Zope's ZCML and ZPT). For # traditional gettext applications, the msgid conversion will # cause no problems since us-ascii should always be a subset of # the charset encoding. We may want to fall back to 8-bit msgids # if the Unicode conversion fails. if '\x00' in msg: # Plural forms msgid1, msgid2 = msg.split('\x00') tmsg = tmsg.split('\x00') if self._charset: msgid1 = str(msgid1, self._charset) tmsg = [str(x, self._charset) for x in tmsg] for i in range(len(tmsg)): catalog[(msgid1, i)] = tmsg[i] else: if self._charset: msg = str(msg, self._charset) tmsg = str(tmsg, self._charset) catalog[msg] = tmsg # advance to next entry in the seek tables masteridx += 8 transidx += 8 | bb04b31df3745d839e1b43ca89ab1d7c5c17b9dd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/bb04b31df3745d839e1b43ca89ab1d7c5c17b9dd/gettext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
12,
2890,
16,
4253,
4672,
3536,
6618,
333,
707,
358,
2865,
10355,
263,
8683,
6449,
12123,
6167,
273,
1958,
18,
17309,
1544,
273,
3869,
12,
7944,
16,
296,
529,
2187,
28707,
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,
389,
2670,
12,
2890,
16,
4253,
4672,
3536,
6618,
333,
707,
358,
2865,
10355,
263,
8683,
6449,
12123,
6167,
273,
1958,
18,
17309,
1544,
273,
3869,
12,
7944,
16,
296,
529,
2187,
28707,
468... | |
m=[] | m = [] | def cacheDetailSize(self): m=[] def f(con, m=m): m.append({'connection':repr(con), 'ngsize':con._cache.cache_non_ghost_count, 'size':len(con._cache)}) self._connectionMap(f) m.sort() return m | 3f5dc8adcf31c234935a3c71325d44bf2f319df0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/3f5dc8adcf31c234935a3c71325d44bf2f319df0/DB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1247,
6109,
1225,
12,
2890,
4672,
312,
273,
5378,
1652,
284,
12,
591,
16,
312,
33,
81,
4672,
312,
18,
6923,
12590,
11,
4071,
4278,
12715,
12,
591,
3631,
296,
82,
564,
554,
4278,
591,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1247,
6109,
1225,
12,
2890,
4672,
312,
273,
5378,
1652,
284,
12,
591,
16,
312,
33,
81,
4672,
312,
18,
6923,
12590,
11,
4071,
4278,
12715,
12,
591,
3631,
296,
82,
564,
554,
4278,
591,
... |
function which only close sockets, we iterates over all existent | function which only close sockets, we iterate over all existent | def close_all(self, map=None, ignore_all=False): """'clean' shutdown: instead of using the current asyncore.close_all() function which only close sockets, we iterates over all existent channels calling close() method for each one of them, avoiding memory leaks. This is how close_all function will appear in the fixed version of asyncore that will be included into Python 2.6. """ if map is None: map = self._map for x in map.values(): try: x.close() except OSError, x: if x[0] == errno.EBADF: pass elif not ignore_all: raise except (asyncore.ExitNow, KeyboardInterrupt, SystemExit): raise except: if not ignore_all: raise map.clear() | e1763c9db15d5d6d781646fb0678f3c70d95867a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/e1763c9db15d5d6d781646fb0678f3c70d95867a/FTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
454,
12,
2890,
16,
852,
33,
7036,
16,
2305,
67,
454,
33,
8381,
4672,
3536,
11,
6200,
11,
5731,
30,
3560,
434,
1450,
326,
783,
4326,
479,
18,
4412,
67,
454,
1435,
445,
1492,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
454,
12,
2890,
16,
852,
33,
7036,
16,
2305,
67,
454,
33,
8381,
4672,
3536,
11,
6200,
11,
5731,
30,
3560,
434,
1450,
326,
783,
4326,
479,
18,
4412,
67,
454,
1435,
445,
1492,... |
c.repo_name = repo_name = org_e['PATH_INFO'].split('/')[1] | try: c.repo_name = org_e['PATH_INFO'].split('/')[1] except IndexError: c.repo_name = '' | def document(self): resp = request.environ.get('pylons.original_response') log.debug('### %s ###', resp.status) | 14ac826748311a9206cce7635e1c1ab16f1f3171 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4230/14ac826748311a9206cce7635e1c1ab16f1f3171/error.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1668,
12,
2890,
4672,
1718,
273,
590,
18,
28684,
18,
588,
2668,
2074,
80,
7008,
18,
8830,
67,
2740,
6134,
225,
613,
18,
4148,
2668,
13151,
738,
87,
11849,
2187,
1718,
18,
2327,
13,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1668,
12,
2890,
4672,
1718,
273,
590,
18,
28684,
18,
588,
2668,
2074,
80,
7008,
18,
8830,
67,
2740,
6134,
225,
613,
18,
4148,
2668,
13151,
738,
87,
11849,
2187,
1718,
18,
2327,
13,
2,
... |
nodeinfo = rpc.call_node_info([node_current], self.cfg.GetVGName()) if not nodeinfo: raise errors.OpExecError("Could not contact node %s for infos" % (node_current)) freememory = nodeinfo[node_current]['memory_free'] memory = instance.memory if memory > freememory: raise errors.OpExecError("Not enough memory to start instance" " %s on node %s" " needed %s MiB, available %s MiB" % (instance.name, node_current, memory, freememory)) | def Exec(self, feedback_fn): """Start the instance. | d4f16fd96dad14244aeb0c05732dd8dc04d472af /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/d4f16fd96dad14244aeb0c05732dd8dc04d472af/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3889,
12,
2890,
16,
10762,
67,
4293,
4672,
3536,
1685,
326,
791,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
3889,
12,
2890,
16,
10762,
67,
4293,
4672,
3536,
1685,
326,
791,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
c._compileDefaultDataSet() if c.__dict__.has_key('DataSet'): cls._DataSet.update(c.DataSet) | curBase._compileDefaultDataSet() cls._DataSet.update(curBase._DataSet) if 'DataSet' in cls.__dict__: cls._DataSet.update(cls.DataSet) | def defaultGetter(self, name=name, default=cls.DataSet[name]): return getattr(self, name, default) | a5502e3b4356f4f45e024207aac488f2123a57b9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8543/a5502e3b4356f4f45e024207aac488f2123a57b9/PythonUtil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
8461,
12,
2890,
16,
508,
33,
529,
16,
805,
33,
6429,
18,
13676,
63,
529,
65,
4672,
327,
3869,
12,
2890,
16,
508,
16,
805,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
805,
8461,
12,
2890,
16,
508,
33,
529,
16,
805,
33,
6429,
18,
13676,
63,
529,
65,
4672,
327,
3869,
12,
2890,
16,
508,
16,
805,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif key == 'AzElDir': options.azeldir.set(value) | elif key == 'AzElDir': options.azeldir.set(value.replace(" | def update(): global root_geom,isec0,naz,nel,ndmiles,ndkm,nhotaz,nhotabetter,nopen, \ im,pim,cmap0,isync,isync441,isync6m,isync65,isync_save,idsec, \ first,itol,txsnrdb,tx6alt utc=time.gmtime(time.time()+0.1*idsec) isec=utc[5] if isec != isec0: #Do once per second isec0=isec t=time.strftime('%Y %b %d\n%H:%M:%S',utc) Audio.gcom2.utcdate=t[:12] ldate.configure(text=t) root_geom=root.geometry() utchours=utc[3]+utc[4]/60.0 + utc[5]/3600.0 naz,nel,ndmiles,ndkm,nhotaz,nhotabetter=Audio.azdist0( \ options.MyGrid.get().upper(),HisGrid.get().upper(),utchours) azdist() g.nfreq=nfreq.get() if Audio.gcom2.ndecoding==0: g.AzSun,g.ElSun,g.AzMoon,g.ElMoon,g.AzMoonB,g.ElMoonB,g.ntsky, \ g.ndop,g.ndop00,g.dbMoon,g.RAMoon,g.DecMoon,g.HA8,g.Dgrd, \ g.sd,g.poloffset,g.MaxNR,g.dfdt,g.dfdt0,g.RaAux,g.DecAux, \ g.AzAux,g.ElAux = Audio.astro0(utc[0],utc[1],utc[2], \ utchours,nfreq.get(),options.MyGrid.get().upper(), \ options.auxra.get()+' '[:9], \ options.auxdec.get()+' '[:9]) if len(HisGrid.get().strip())<4: g.ndop=g.ndop00 g.dfdt=g.dfdt0 Audio.gcom2.ntx2=0 if ntx.get()==1 and noshjt65.get()==1: Audio.gcom2.ntx2=1 if mode.get()[:4]=='JT65' or mode.get()[:3]=='JT2' or \ mode.get()[:3]=='JT4' or mode.get()[:2]=='CW': graph2.delete(ALL) graph2.create_text(80,13,anchor=CENTER,text="Moon",font=g2font) graph2.create_text(13,37,anchor=W, text="Az: %6.2f" % g.AzMoon,font=g2font) graph2.create_text(13,61,anchor=W, text="El: %6.2f" % g.ElMoon,font=g2font) graph2.create_text(13,85,anchor=W, text="Dop:%6d" % g.ndop,font=g2font) graph2.create_text(13,109,anchor=W,text="Dgrd:%5.1f" % g.Dgrd,font=g2font) if (mode.get()[:4]=='JT65' or mode.get()[:3]=='JT2' or \ mode.get()[:3]=='JT4') and g.freeze_decode: itol=2 ltol.configure(text='Tol '+str(50)) Audio.gcom2.dftolerance=50 nfreeze.set(1) Audio.gcom2.nfreeze=1 if Audio.gcom2.monitoring: Audio.gcom2.ndecoding=1 Audio.gcom2.nagain=0 else: Audio.gcom2.ndecoding=4 Audio.gcom2.nagain=1 g.freeze_decode=0 n=int(20.0*log10(g.rms/770.0+0.01)) t="Rx noise:%3d dB" % (n,) if n>=-10 and n<=10: msg4.configure(text=t,bg='gray85') else: msg4.configure(text=t,bg='red') t=g.ftnstr(Audio.gcom2.decodedfile) | c6791a70febfb77e8bbc2ce66d1f17dac87aa283 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2394/c6791a70febfb77e8bbc2ce66d1f17dac87aa283/wsjt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
13332,
2552,
1365,
67,
10049,
16,
291,
557,
20,
16,
82,
1561,
16,
3084,
16,
4880,
81,
1449,
16,
82,
2883,
81,
16,
82,
15224,
1561,
16,
82,
15224,
378,
11214,
16,
82,
3190,
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,
13332,
2552,
1365,
67,
10049,
16,
291,
557,
20,
16,
82,
1561,
16,
3084,
16,
4880,
81,
1449,
16,
82,
2883,
81,
16,
82,
15224,
1561,
16,
82,
15224,
378,
11214,
16,
82,
3190,
16,
... |
print chanString | def plotsnrchisq(gpsTime,frameFile,ligoName,chisqBins,chisqDelta,outputPath): # BE CAREFUL ! The length of the frame file itself (without taking into account the path) is supposed to be 30 characters ! ind1 = len(frameFile) - 30 # this variable is also used in the definition of the plot title ind2 = ind1 + 2 ifoName = frameFile[ind1:ind2] print ifoName chanString = ifoName + ':' + ligoName + '_SNRSQ_0' print chanString # find the start time of the first channel # BE CAREFUL ! it is assumed that the sampling frequency is higher than 200 Hz testOnFirstChannel = frgetvect.frgetvect(frameFile,chanString,-1,0.01,0) gpsStart = testOnFirstChannel[3] # This actually prints only one digit after the . print gpsStart # find the channel which contains the data we want to look at # BE CAREFUL ! it is assumed that the segment length is 128 s segmentLength = 128. position = (float(gpsTime) - float(gpsStart) - segmentLength/2.)/segmentLength position = int(position) chanNumber = str(position) chanNameSnr = ifoName + ':' + ligoName + '_SNRSQ_' + chanNumber print chanNameSnr chanNameChisq = ifoName + ':' + ligoName + '_CHISQ_' + chanNumber # now, read the data !! # The window width should be an input argument maybe ? duration = 2.0 startWindow = float(gpsTime) - duration/2. squareSnr_tuple = frgetvect.frgetvect(frameFile,chanNameSnr,startWindow,duration,0) print squareSnr_tuple[0] squareChisq_tuple = frgetvect.frgetvect(frameFile,chanNameChisq,startWindow,duration,0) # compute the snr vector snr_vector = sqrt(squareSnr_tuple[0]) print snr_vector snr_time = squareSnr_tuple[1] print snr_time # compute the r^2 rsq_vector = squareChisq_tuple[0] chisq_time = squareChisq_tuple[1] print rsq_vector # compute the normalized chisq chisqNorm_vector = rsq_vector/(1 + chisqDelta/chisqBins*squareSnr_tuple[0]) print chisqNorm_vector # Now plot the snr time serie !! figure(1) plot(snr_time - duration/2.,snr_vector) xlabel('time (s)',size='x-large') ylabel(r'$\rho$',size='x-large') grid(1) title(ifoName + ' trigger: ' + gpsTime) savefig(ifoName + '_' + str(int(float(gpsTime))) + '_snr.png') # Now plot the r^2 time serie !! figure(2) plot(chisq_time - duration/2.,rsq_vector) xlabel('time (s)',size='x-large') ylabel(r'$r^2$',size='x-large') grid(1) title(ifoName + ' trigger: ' + gpsTime) savefig(ifoName + '_' + str(int(float(gpsTime))) + '_rsq.png') # Now plot the normalized chisq time serie !! figure(3) plot(chisq_time - duration/2.,chisqNorm_vector) xlabel('time (s)',size='x-large') ylabel(r'$\chi^2 / (p + \delta^2\rho^2)$',size='x-large') grid(1) title(ifoName + ' trigger: ' + gpsTime) savefig(ifoName + '_' + str(int(float(gpsTime))) + '_chisq.png') | 5500c5862e20bba832c1849255466b92ac551b52 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3592/5500c5862e20bba832c1849255466b92ac551b52/plotsnrchisq_pipe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
8134,
86,
343,
291,
85,
12,
75,
1121,
950,
16,
3789,
812,
16,
80,
17626,
461,
16,
343,
291,
85,
38,
2679,
16,
343,
291,
85,
9242,
16,
2844,
743,
4672,
225,
468,
9722,
6425,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
8134,
86,
343,
291,
85,
12,
75,
1121,
950,
16,
3789,
812,
16,
80,
17626,
461,
16,
343,
291,
85,
38,
2679,
16,
343,
291,
85,
9242,
16,
2844,
743,
4672,
225,
468,
9722,
6425,
1... | |
msg = '' | def pollNextLocale(self): if not self.pendingLocales: self.activeRequests -= 1 if not self.activeRequests: msg = "Done with all locales" loadTimes = map(lambda p: p.loadTime, self.localePollers.values()) goodTimes = filter(lambda t: t is not None, loadTimes) msg = '' if not goodTimes: msg += ". All %d locale pollers failed" % len(loadTimes) else: msg += ", min: %.1f, max: %.1f, mean: %.1f" % \ (min(goodTimes), max(goodTimes), sum(goodTimes) / len(goodTimes)) if len(loadTimes) > len(goodTimes): msg += ", %d failed" % (len(loadTimes) - len(goodTimes)) log.msg(msg) log.msg("Total time: %.1f" % (time.time() - self.startLoad)) return loc = self.pendingLocales.pop(0) poller = self.getLocalePoller(loc) poller.poll() | 2cf300cbce6277f8d8862e28593fbdd4a5733b4b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6206/2cf300cbce6277f8d8862e28593fbdd4a5733b4b/hgpoller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
2134,
3916,
12,
2890,
4672,
309,
486,
365,
18,
9561,
13310,
30,
365,
18,
3535,
6421,
3947,
404,
309,
486,
365,
18,
3535,
6421,
30,
1234,
273,
315,
7387,
598,
777,
6922,
6,
1262,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7672,
2134,
3916,
12,
2890,
4672,
309,
486,
365,
18,
9561,
13310,
30,
365,
18,
3535,
6421,
3947,
404,
309,
486,
365,
18,
3535,
6421,
30,
1234,
273,
315,
7387,
598,
777,
6922,
6,
1262,
... | |
content_io = StringIO.StringIO(report.report_content) | content_io = StringIO.StringIO() content_io.write(report.report_content) | def parse(self, cursor, user, report, objects, datas, context): localcontext = {} localcontext['datas'] = datas localcontext['objects'] = objects localcontext['user'] = self.pool.get('res.user').\ browse(cursor, user, user) localcontext['_language_cache'] = {} localcontext.update(context) if not report.report_content: raise ExceptOSV('Error', 'Missing report file!') content_io = StringIO.StringIO(report.report_content) content_z = zipfile.ZipFile(content_io, mode='r') content_xml = content_z.read('content.xml') dom = xml.dom.minidom.parseString(content_xml) node = dom.documentElement self._parse_node(cursor, user, node, localcontext, context) | bb91f8cbedde5dc0a73dcc24dba08b29ffb114bf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9266/bb91f8cbedde5dc0a73dcc24dba08b29ffb114bf/report.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
3347,
16,
729,
16,
2605,
16,
2184,
16,
5386,
16,
819,
4672,
1191,
2472,
273,
2618,
1191,
2472,
3292,
13178,
3546,
273,
5386,
1191,
2472,
3292,
6911,
3546,
273,
2184,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16,
3347,
16,
729,
16,
2605,
16,
2184,
16,
5386,
16,
819,
4672,
1191,
2472,
273,
2618,
1191,
2472,
3292,
13178,
3546,
273,
5386,
1191,
2472,
3292,
6911,
3546,
273,
2184,
... |
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('sum').encode('utf8')) | trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('sum')) | def check_group(node): if node.get('groups'): groups = node.get('groups').split(',') access_pool = self.pool.get('ir.model.access') can_see = any(access_pool.check_groups(cr, user, group) for group in groups) if not can_see: node.set('invisible', '1') if 'attrs' in node.attrib: del(node.attrib['attrs']) #avoid making field visible later del(node.attrib['groups']) return can_see else: return True | 3dd004798135bad79208cd34821a64f7f7cbede1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/3dd004798135bad79208cd34821a64f7f7cbede1/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1655,
12,
2159,
4672,
309,
756,
18,
588,
2668,
4650,
11,
4672,
3252,
273,
756,
18,
588,
2668,
4650,
16063,
4939,
12,
2187,
6134,
2006,
67,
6011,
273,
365,
18,
6011,
18,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
1655,
12,
2159,
4672,
309,
756,
18,
588,
2668,
4650,
11,
4672,
3252,
273,
756,
18,
588,
2668,
4650,
16063,
4939,
12,
2187,
6134,
2006,
67,
6011,
273,
365,
18,
6011,
18,
588,
... |
if type (self.libs) is StringType: self.libs = [self.libs] | if type (self.libraries) is StringType: self.libraries = [self.libraries] | def finalize_options (self): from distutils import sysconfig | b88ce739cc9c3e3ea5ab098a7c55dd9a8e7bd501 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/b88ce739cc9c3e3ea5ab098a7c55dd9a8e7bd501/build_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
628,
2411,
5471,
1930,
2589,
1425,
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,
12409,
67,
2116,
261,
2890,
4672,
628,
2411,
5471,
1930,
2589,
1425,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
ns['start'] = Time.encode(properties('DTSTART').value.time()) ns['end'] = Time.encode(properties('DTEND').value.time()) ns['TIME'] = '%s - %s' % (ns['start'], ns['end']) | start = properties('DTSTART') end = properties('DTEND') params = start.parameters if 'VALUE' in params and 'DATE' in params['VALUE']: ns['start'] = ns['end'] = ns['TIME'] = None elif start.value.date() != end.value.date(): ns['start'] = ns['end'] = ns['TIME'] = None else: ns['start'] = Time.encode(start.value.time()) ns['end'] = Time.encode(end.value.time()) ns['TIME'] = '%s - %s' % (ns['start'], ns['end']) | def get_grid_ns_event(self, day, event, resource_name=None, conflicts_list=[], timetable=None): """ Specify the namespace given on views to represent an event. | 6419f28b72f2c6e6a3e55cbeb732fd9415afee87 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12681/6419f28b72f2c6e6a3e55cbeb732fd9415afee87/ical.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
5222,
67,
2387,
67,
2575,
12,
2890,
16,
2548,
16,
871,
16,
1058,
67,
529,
33,
7036,
16,
14450,
67,
1098,
22850,
6487,
26668,
429,
33,
7036,
4672,
3536,
21664,
326,
1981,
864,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
67,
5222,
67,
2387,
67,
2575,
12,
2890,
16,
2548,
16,
871,
16,
1058,
67,
529,
33,
7036,
16,
14450,
67,
1098,
22850,
6487,
26668,
429,
33,
7036,
4672,
3536,
21664,
326,
1981,
864,
... |
mock = PyPycLoaderMock({name: 'path/to/mod'}) | mock = PyPycLoaderMock({name: os.path.join('path', 'to', 'mod')}) | def test_bytecode_path_ImportError(self): # An ImportError from bytecode_path should trigger an ImportError. name = 'mod' mock = PyPycLoaderMock({name: 'path/to/mod'}) bad_meth = types.MethodType(raise_ImportError, mock) mock.bytecode_path = bad_meth with util.uncache(name): self.assertRaises(ImportError, mock.load_module, name) | 3714e816446d00f205edc184db1f131faf6bf12b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3187/3714e816446d00f205edc184db1f131faf6bf12b/test_abc_loader.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1637,
16651,
67,
803,
67,
5010,
668,
12,
2890,
4672,
468,
1922,
11308,
628,
22801,
67,
803,
1410,
3080,
392,
11308,
18,
508,
273,
296,
1711,
11,
5416,
273,
4707,
9413,
71,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1637,
16651,
67,
803,
67,
5010,
668,
12,
2890,
4672,
468,
1922,
11308,
628,
22801,
67,
803,
1410,
3080,
392,
11308,
18,
508,
273,
296,
1711,
11,
5416,
273,
4707,
9413,
71,
28... |
statbuf = () return statbuf | return None | def statfile(path): try: statbuf = os.stat(path) except OSError: statbuf = () return statbuf | 24f995543f249e38a6a77cb90c332b73d19ccec2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1390/24f995543f249e38a6a77cb90c332b73d19ccec2/provider.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
610,
768,
12,
803,
4672,
775,
30,
610,
4385,
273,
1140,
18,
5642,
12,
803,
13,
1335,
10002,
30,
327,
599,
225,
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,
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,
610,
768,
12,
803,
4672,
775,
30,
610,
4385,
273,
1140,
18,
5642,
12,
803,
13,
1335,
10002,
30,
327,
599,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.