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 |
|---|---|---|---|---|---|---|
self._file.write(struct.pack('<lsslhhllhhs', | self._file.write(struct.pack('<l4s4slhhllhh4s', | def _write_header(self, initlength): self._file.write('RIFF') if not self._nframes: self._nframes = initlength / (self._nchannels * self._sampwidth) self._datalength = self._nframes * self._nchannels * self._sampwidth self._form_length_pos = self._file.tell() self._file.write(struct.pack('<lsslhhllhhs', 36 + self._datalength, 'WAVE', 'fmt ', 16, WAVE_FORMAT_PCM, self._nchannels, self._framerate, self._nchannels * self._framerate * self._sampwidth, self._nchannels * self._sampwidth, self._sampwidth * 8, 'data')) self._data_length_pos = self._file.tell() self._file.write(struct.pack('<l', self._datalength)) | 066ed92cf179239da3e527c80447bf84d1b3b647 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/066ed92cf179239da3e527c80447bf84d1b3b647/wave.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
3374,
12,
2890,
16,
1208,
2469,
4672,
365,
6315,
768,
18,
2626,
2668,
2259,
2246,
6134,
309,
486,
365,
6315,
82,
10278,
30,
365,
6315,
82,
10278,
273,
1208,
2469,
342,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2626,
67,
3374,
12,
2890,
16,
1208,
2469,
4672,
365,
6315,
768,
18,
2626,
2668,
2259,
2246,
6134,
309,
486,
365,
6315,
82,
10278,
30,
365,
6315,
82,
10278,
273,
1208,
2469,
342,
2... |
self.processors = processors | self.processors = dict([ (key.lower(), value) for key, value in processors.items() ]) | def __init__(self, path, defaultType="text/plain", ignoredExts=(), processors=None, indexNames=None): """Create a file with the given path. """ self.fp = filepath.FilePath(path) # Remove the dots from the path to split self.defaultType = defaultType self.ignoredExts = list(ignoredExts) self.children = {} if processors is not None: self.processors = processors if indexNames is not None: self.indexNames = indexNames | fd0b7638e9b10bd787b8020af074d284fa521b56 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/fd0b7638e9b10bd787b8020af074d284fa521b56/static.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
805,
559,
1546,
955,
19,
7446,
3113,
5455,
2482,
87,
33,
9334,
13399,
33,
7036,
16,
770,
1557,
33,
7036,
4672,
3536,
1684,
279,
585,
598,
326,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
589,
16,
805,
559,
1546,
955,
19,
7446,
3113,
5455,
2482,
87,
33,
9334,
13399,
33,
7036,
16,
770,
1557,
33,
7036,
4672,
3536,
1684,
279,
585,
598,
326,
... |
StaticImageExample(filename, renderer).configure_traits() | StaticImageExample(filename, Renderer).configure_traits() | def __init__(self, filename, renderer, *args, **kw): super(StaticImageExample, self).__init__(*args, **kw) | 464bdc2915ab61a4bd607ebb32c25a4808397cdf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13166/464bdc2915ab61a4bd607ebb32c25a4808397cdf/static_image.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1544,
16,
5690,
16,
380,
1968,
16,
2826,
9987,
4672,
2240,
12,
5788,
2040,
10908,
16,
365,
2934,
972,
2738,
972,
30857,
1968,
16,
2826,
9987,
13,
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,
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,
1544,
16,
5690,
16,
380,
1968,
16,
2826,
9987,
4672,
2240,
12,
5788,
2040,
10908,
16,
365,
2934,
972,
2738,
972,
30857,
1968,
16,
2826,
9987,
13,
2,
-100... |
self.classColors = OWGraphTools.ColorPaletteHSV(len(data.domain.classVar.values)) | def setData(self, attr, data): self.clear() self.attr, self.data = attr, data self.curCutPoints = [] | 41cb72cd253301f793c8aa2037bed816549a0eb8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/41cb72cd253301f793c8aa2037bed816549a0eb8/OWInteractiveDiscretization.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7929,
12,
2890,
16,
1604,
16,
501,
4672,
365,
18,
8507,
1435,
365,
18,
1747,
16,
365,
18,
892,
273,
1604,
16,
501,
365,
18,
1397,
15812,
5636,
273,
5378,
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,
7929,
12,
2890,
16,
1604,
16,
501,
4672,
365,
18,
8507,
1435,
365,
18,
1747,
16,
365,
18,
892,
273,
1604,
16,
501,
365,
18,
1397,
15812,
5636,
273,
5378,
2,
-100,
-100,
-100,
-100,
-... | |
'%define version ' + self.distribution.get_version(), '%define release ' + self.release, | '%define version ' + self.distribution.get_version().replace('-','_'), '%define release ' + self.release.replace('-','_'), | def _make_spec_file(self): """Generate the text of an RPM spec file and return it as a list of strings (one per line). """ # definitions and headers spec_file = [ '%define name ' + self.distribution.get_name(), '%define version ' + self.distribution.get_version(), '%define release ' + self.release, '', 'Summary: ' + self.distribution.get_description(), ] | f1d91665759a1c9578ca0c28a60b6da834c577b5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/f1d91665759a1c9578ca0c28a60b6da834c577b5/bdist_rpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
2793,
67,
768,
12,
2890,
4672,
3536,
4625,
326,
977,
434,
392,
534,
12728,
857,
585,
471,
327,
518,
487,
279,
666,
434,
2064,
261,
476,
1534,
980,
2934,
3536,
468,
6377,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6540,
67,
2793,
67,
768,
12,
2890,
4672,
3536,
4625,
326,
977,
434,
392,
534,
12728,
857,
585,
471,
327,
518,
487,
279,
666,
434,
2064,
261,
476,
1534,
980,
2934,
3536,
468,
6377,... |
instance.hints) | instance.hints, instance.id) | def instantiateVm(self, instance): # FIXME: this is NOT the right way to get out hostId self.hostId = instance.hostId | dc2625d190a002385b816fa7373a198643dabce1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5161/dc2625d190a002385b816fa7373a198643dabce1/xenpv.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10275,
22143,
12,
2890,
16,
791,
4672,
468,
9852,
30,
333,
353,
4269,
326,
2145,
4031,
358,
336,
596,
1479,
548,
365,
18,
2564,
548,
273,
791,
18,
2564,
548,
2,
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,
10275,
22143,
12,
2890,
16,
791,
4672,
468,
9852,
30,
333,
353,
4269,
326,
2145,
4031,
358,
336,
596,
1479,
548,
365,
18,
2564,
548,
273,
791,
18,
2564,
548,
2,
-100,
-100,
-100,
-100,... |
if len(m) == 1: | if len(m) == 0: pass elif len(m) == 1: | def parse(self, mv): """ This function allows one to create the permutation group element from a variety of formats. | 13312bf3cf559432f574e5759a133255677df6ba /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/13312bf3cf559432f574e5759a133255677df6ba/cubegroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
7701,
4672,
3536,
1220,
445,
5360,
1245,
358,
752,
326,
17440,
1041,
930,
628,
279,
1394,
14369,
434,
6449,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
12,
2890,
16,
7701,
4672,
3536,
1220,
445,
5360,
1245,
358,
752,
326,
17440,
1041,
930,
628,
279,
1394,
14369,
434,
6449,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
rrule_string = 'FREQ=' + freq.upper() + weekstring + ';INTERVAL=' + \ str(datas.get('interval')) + enddate + monthstring + yearstring | rrule_string = 'FREQ=' + freq.upper() + weekstring + interval_srting \ + enddate + monthstring + yearstring | def compute_rule_string(self, cr, uid, datas, context=None, *args): """ Compute rule string. @param self: the object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param datas: dictionary of freq and interval value. @return: string value which compute FREQILY;INTERVAL """ | be62cac907e916d2ae64f7efd194e7c889eea71e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be62cac907e916d2ae64f7efd194e7c889eea71e/base_calendar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
5345,
67,
1080,
12,
2890,
16,
4422,
16,
4555,
16,
5386,
16,
819,
33,
7036,
16,
380,
1968,
4672,
3536,
8155,
1720,
533,
18,
632,
891,
365,
30,
326,
733,
4407,
632,
891,
4422... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3671,
67,
5345,
67,
1080,
12,
2890,
16,
4422,
16,
4555,
16,
5386,
16,
819,
33,
7036,
16,
380,
1968,
4672,
3536,
8155,
1720,
533,
18,
632,
891,
365,
30,
326,
733,
4407,
632,
891,
4422... |
return join_string.join([c.term for c in entry.category if c.term]) | return self.intra_property_delimiter.join( [c.term for c in self.entry.category if c.term]) | def tags(self): """Tags / keywords or labels.""" try: return entry.media.description.keywords.text except AttributeError: # Blogger uses categories. return join_string.join([c.term for c in entry.category if c.term]) | dd904047fd3cf9b43053c0e4ce93373a0205af9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2899/dd904047fd3cf9b43053c0e4ce93373a0205af9d/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2342,
12,
2890,
4672,
3536,
3453,
342,
7093,
578,
3249,
12123,
775,
30,
327,
1241,
18,
5829,
18,
3384,
18,
11771,
18,
955,
1335,
6394,
30,
468,
605,
4901,
4692,
6477,
18,
327,
1233,
67... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2342,
12,
2890,
4672,
3536,
3453,
342,
7093,
578,
3249,
12123,
775,
30,
327,
1241,
18,
5829,
18,
3384,
18,
11771,
18,
955,
1335,
6394,
30,
468,
605,
4901,
4692,
6477,
18,
327,
1233,
67... |
self.ChromiumSyncTimeHandler, | def __init__(self, request, client_address, socket_server): self._connect_handlers = [ self.RedirectConnectHandler, self.ServerAuthConnectHandler, self.DefaultConnectResponseHandler] self._get_handlers = [ self.NoCacheMaxAgeTimeHandler, self.NoCacheTimeHandler, self.CacheTimeHandler, self.CacheExpiresHandler, self.CacheProxyRevalidateHandler, self.CachePrivateHandler, self.CachePublicHandler, self.CacheSMaxAgeHandler, self.CacheMustRevalidateHandler, self.CacheMustRevalidateMaxAgeHandler, self.CacheNoStoreHandler, self.CacheNoStoreMaxAgeHandler, self.CacheNoTransformHandler, self.DownloadHandler, self.DownloadFinishHandler, self.EchoHeader, self.EchoHeaderOverride, self.EchoAllHandler, self.FileHandler, self.RealFileWithCommonHeaderHandler, self.RealBZ2FileWithCommonHeaderHandler, self.SetCookieHandler, self.AuthBasicHandler, self.AuthDigestHandler, self.SlowServerHandler, self.ContentTypeHandler, self.ServerRedirectHandler, self.ClientRedirectHandler, self.ChromiumSyncTimeHandler, self.MultipartHandler, self.DefaultResponseHandler] self._post_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.ChromiumSyncCommandHandler, self.EchoHandler, self.DeviceManagementHandler] + self._get_handlers self._put_handlers = [ self.EchoTitleHandler, self.EchoAllHandler, self.EchoHandler] + self._get_handlers | 46d7e577d0e847e6026682c5b5b949a376ec7be3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/46d7e577d0e847e6026682c5b5b949a376ec7be3/testserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
590,
16,
1004,
67,
2867,
16,
2987,
67,
3567,
4672,
365,
6315,
3612,
67,
11046,
273,
306,
365,
18,
5961,
5215,
1503,
16,
365,
18,
2081,
1730,
5215,
1503,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
590,
16,
1004,
67,
2867,
16,
2987,
67,
3567,
4672,
365,
6315,
3612,
67,
11046,
273,
306,
365,
18,
5961,
5215,
1503,
16,
365,
18,
2081,
1730,
5215,
1503,
... | |
currentcf['options'] = "\n".join(currentcf['options']) | optional_line = '' if currentcf.get('optional', False): optional_line = "\n\n" currentcf['options'] = optional_line + "\n".join(currentcf['options']) | def _customfield_from_req(self, req): cfdict = {'name': to_unicode(req.args.get('name')), 'label': to_unicode(req.args.get('label')), 'type': to_unicode(req.args.get('type')), 'value': to_unicode(req.args.get('value')), 'options': [x.strip() for x in to_unicode(req.args.get('options')).split("\n")], 'cols': to_unicode(req.args.get('cols')), 'rows': to_unicode(req.args.get('rows')), 'order': req.args.get('order', 0)} return cfdict | 04a32bb6021f25239786620be5d6e50cf1812f3f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4/04a32bb6021f25239786620be5d6e50cf1812f3f/customfieldadmin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3662,
1518,
67,
2080,
67,
3658,
12,
2890,
16,
1111,
4672,
6080,
1576,
273,
13666,
529,
4278,
358,
67,
9124,
12,
3658,
18,
1968,
18,
588,
2668,
529,
6134,
3631,
296,
1925,
4278,
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,
389,
3662,
1518,
67,
2080,
67,
3658,
12,
2890,
16,
1111,
4672,
6080,
1576,
273,
13666,
529,
4278,
358,
67,
9124,
12,
3658,
18,
1968,
18,
588,
2668,
529,
6134,
3631,
296,
1925,
4278,
35... |
"exclude=", "include=", "package=", "strip") | "exclude=", "include=", "package=", "strip", "iconfile=") | def main(builder=None): if builder is None: builder = AppBuilder(verbosity=1) shortopts = "b:n:r:e:m:c:p:lx:i:hvq" longopts = ("builddir=", "name=", "resource=", "executable=", "mainprogram=", "creator=", "nib=", "plist=", "link", "link-exec", "help", "verbose", "quiet", "standalone", "exclude=", "include=", "package=", "strip") try: options, args = getopt.getopt(sys.argv[1:], shortopts, longopts) except getopt.error: usage() for opt, arg in options: if opt in ('-b', '--builddir'): builder.builddir = arg elif opt in ('-n', '--name'): builder.name = arg elif opt in ('-r', '--resource'): builder.resources.append(arg) elif opt in ('-e', '--executable'): builder.executable = arg elif opt in ('-m', '--mainprogram'): builder.mainprogram = arg elif opt in ('-c', '--creator'): builder.creator = arg elif opt == "--nib": builder.nibname = arg elif opt in ('-p', '--plist'): builder.plist = Plist.fromFile(arg) elif opt in ('-l', '--link'): builder.symlink = 1 elif opt == '--link-exec': builder.symlink_exec = 1 elif opt in ('-h', '--help'): usage() elif opt in ('-v', '--verbose'): builder.verbosity += 1 elif opt in ('-q', '--quiet'): builder.verbosity -= 1 elif opt == '--standalone': builder.standalone = 1 elif opt in ('-x', '--exclude'): builder.excludeModules.append(arg) elif opt in ('-i', '--include'): builder.includeModules.append(arg) elif opt == '--package': builder.includePackages.append(arg) elif opt == '--strip': builder.strip = 1 if len(args) != 1: usage("Must specify one command ('build', 'report' or 'help')") command = args[0] if command == "build": builder.setup() builder.build() elif command == "report": builder.setup() builder.report() elif command == "help": usage() else: usage("Unknown command '%s'" % command) | 11edf2e129a41542c8d7ba1370ddf7d44d0a83e0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/11edf2e129a41542c8d7ba1370ddf7d44d0a83e0/bundlebuilder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
9574,
33,
7036,
4672,
309,
2089,
353,
599,
30,
2089,
273,
4677,
1263,
12,
16629,
8807,
33,
21,
13,
225,
3025,
4952,
273,
315,
70,
30,
82,
30,
86,
30,
73,
30,
81,
30,
71,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9574,
33,
7036,
4672,
309,
2089,
353,
599,
30,
2089,
273,
4677,
1263,
12,
16629,
8807,
33,
21,
13,
225,
3025,
4952,
273,
315,
70,
30,
82,
30,
86,
30,
73,
30,
81,
30,
71,
... |
if (NULL != %(_z)s) Py_XDECREF(%(_z)s); | if (NULL != %(_zout)s) Py_XDECREF(%(_zout)s); | def __str__(self): return "_dot22" | a5256ba2c40614a069040dbec774df5c09684923 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/a5256ba2c40614a069040dbec774df5c09684923/blas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
2890,
4672,
327,
4192,
9811,
3787,
6,
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,
1001,
701,
972,
12,
2890,
4672,
327,
4192,
9811,
3787,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def resize_cover(im, opts): width, height = im.size dw, dh = (opts.profile.screen_size[0]-width)/float(width), (opts.profile.screen_size[1]-height)/float(height) delta = min(dw, dh) if delta > 0: nwidth = int(width + delta*(width)) nheight = int(height + delta*(height)) im = im.resize((int(nwidth), int(nheight)), PILImage.ANTIALIAS) return im | def resize_cover(im, opts): width, height = im.size dw, dh = (opts.profile.screen_size[0]-width)/float(width), (opts.profile.screen_size[1]-height)/float(height) delta = min(dw, dh) if delta > 0: nwidth = int(width + delta*(width)) nheight = int(height + delta*(height)) im = im.resize((int(nwidth), int(nheight)), PILImage.ANTIALIAS) return im | de679ed342f050162ffbe2c6dfdb5246d9173c62 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9125/de679ed342f050162ffbe2c6dfdb5246d9173c62/from_html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
67,
3165,
12,
381,
16,
1500,
4672,
1835,
16,
2072,
273,
709,
18,
1467,
12394,
16,
11007,
273,
261,
4952,
18,
5040,
18,
9252,
67,
1467,
63,
20,
65,
17,
2819,
13176,
5659,
12,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
67,
3165,
12,
381,
16,
1500,
4672,
1835,
16,
2072,
273,
709,
18,
1467,
12394,
16,
11007,
273,
261,
4952,
18,
5040,
18,
9252,
67,
1467,
63,
20,
65,
17,
2819,
13176,
5659,
12,
28... | |
USE_CTYPES_GETPROCESSTIMES = 'cytpes GetProcessTimes() wrapper' | USE_CTYPES_GETPROCESSTIMES = 'ctypes GetProcessTimes() wrapper' | def systimes(): | 8f833926209dae465aebe98428006a4454811f89 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/8f833926209dae465aebe98428006a4454811f89/systimes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
272,
1094,
4485,
13332,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
272,
1094,
4485,
13332,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if pygame.display.toggle_fullscreen(): | if not self._fullscreen: pygame.display.toggle_fullscreen() | def show(self): """De-iconify framebuffer Restore (ie, de-iconify) the graphics display. This really only works in non-fullscreen mode. """ if pygame.display.toggle_fullscreen(): self._fullscreen = 1 | bed92d5042be795d593abfa1981d3f02f506d300 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5701/bed92d5042be795d593abfa1981d3f02f506d300/sprite.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2890,
4672,
3536,
758,
17,
3950,
1164,
2623,
4106,
225,
11197,
261,
1385,
16,
443,
17,
3950,
1164,
13,
326,
17313,
2562,
18,
1220,
8654,
1338,
6330,
316,
1661,
17,
2854,
9252,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
12,
2890,
4672,
3536,
758,
17,
3950,
1164,
2623,
4106,
225,
11197,
261,
1385,
16,
443,
17,
3950,
1164,
13,
326,
17313,
2562,
18,
1220,
8654,
1338,
6330,
316,
1661,
17,
2854,
9252,
... |
mb = mailbox.Maildir(file(options.maildir)) | mb = mailbox.Maildir(options.maildir) | def main(mb, smtp_server): # do the work count = 0 errors = 0 msg = mb.next() count = count + 1 while msg is not None: document = msg.fp.read() headers = msg.__str__( ) # remove Delivered-To headers new_headers = "" for line in headers.splitlines(True): if not line.startswith("Delivered-To"): new_headers += line fullmsg = new_headers + '\x0a' + document try: print "%d Sending mail From: %s on date: %s" % (count, msg.getaddr('From')[1], msg['Date']) server = smtplib.SMTP(smtp_server) server.set_debuglevel(False) server.sendmail(msg.getaddr('From')[1], options.email, fullmsg) server.quit() # for debugging #print fullmsg except: print "Error sending message %d" % (count) print "Exception: ", sys.exc_info()[0] errors = errors + 1 # check queue size before continuing if "localhost" == smtp_server: (num_active, num_deferred, num_hold) = check_postfix_queues.get_queue_lengths() sleep_time = 1 print "Active: %d Deferred: %d" % (num_active, num_deferred) while num_active + num_deferred > threshold: time.sleep(sleep_time) (num_active, num_deferred, num_hold) = check_postfix_queues.get_queue_lengths() print "Active: %d Deferred: %d" % (num_active, num_deferred) sleep_time = sleep_time + 1 else: time.sleep(5) # go to next message msg = mb.next() count = count + 1 print "Attempted to send %d messages, received %d errors" % (count, errors) | 79e07c9bf3d78e642a7905c3b51a44cdccf2aa28 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11912/79e07c9bf3d78e642a7905c3b51a44cdccf2aa28/resend.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1627,
16,
17660,
67,
3567,
4672,
468,
741,
326,
1440,
1056,
273,
374,
1334,
273,
374,
1234,
273,
4903,
18,
4285,
1435,
1056,
273,
1056,
397,
404,
1323,
1234,
353,
486,
599,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
1627,
16,
17660,
67,
3567,
4672,
468,
741,
326,
1440,
1056,
273,
374,
1334,
273,
374,
1234,
273,
4903,
18,
4285,
1435,
1056,
273,
1056,
397,
404,
1323,
1234,
353,
486,
599,
3... |
*** NameError: name 'foo' is not defined | *** NameError: ...foo... | -> def f2(self): | 20069c315e46fe6a82c9f4bca9fbdf5948133373 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6934/20069c315e46fe6a82c9f4bca9fbdf5948133373/test_doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
317,
1652,
284,
22,
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,
317,
1652,
284,
22,
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,... |
self._fail(originator='local', code=code, reason=reason, error='media stream failed: %s' % e.data.reason) | if isinstance(e, api.TimeoutError): error = 'media stream timed out while starting' else: error = 'media stream failed: %s' % e.data.reason self._fail(originator='local', code=code, reason=reason, error=error) | def accept(self, streams): self.greenlet = api.getcurrent() notification_center = NotificationCenter() settings = SIPSimpleSettings() | ca8ff735b715508e573178d1e2ebce06a82a6072 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5703/ca8ff735b715508e573178d1e2ebce06a82a6072/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2791,
12,
2890,
16,
8205,
4672,
365,
18,
11571,
1810,
273,
1536,
18,
588,
2972,
1435,
3851,
67,
5693,
273,
8050,
8449,
1435,
1947,
273,
348,
2579,
5784,
2628,
1435,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2791,
12,
2890,
16,
8205,
4672,
365,
18,
11571,
1810,
273,
1536,
18,
588,
2972,
1435,
3851,
67,
5693,
273,
8050,
8449,
1435,
1947,
273,
348,
2579,
5784,
2628,
1435,
2,
-100,
-100,
-100,
... |
def _s(results): for r in results: if r[0] == defer.FAILURE: raise RuntimeError("message could not be handled") | def _f(err): errmsg = "message handling failed: %s\n%s" % (err.getErrorMessage(), err.getTraceback()) log.warn(errmsg) self.transport.write(str(XenBEEClientError(errmsg))) | def _s(results): for r in results: if r[0] == defer.FAILURE: raise RuntimeError("message could not be handled") return msg | 0aee443c5b0383e0c07f0b722b2bb0b4e50e3f00 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2459/0aee443c5b0383e0c07f0b722b2bb0b4e50e3f00/xsdl.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
74,
12,
370,
4672,
17460,
273,
315,
2150,
5057,
2535,
30,
738,
87,
64,
82,
9,
87,
6,
738,
261,
370,
18,
588,
14935,
9334,
393,
18,
588,
3448,
823,
10756,
613,
18,
8935,
12,
24... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
74,
12,
370,
4672,
17460,
273,
315,
2150,
5057,
2535,
30,
738,
87,
64,
82,
9,
87,
6,
738,
261,
370,
18,
588,
14935,
9334,
393,
18,
588,
3448,
823,
10756,
613,
18,
8935,
12,
24... |
self.nextButton.connect_object("clicked",self.main,self.window.get_child()) self.quizWidget['stop'].hide() def options(self,oldbox): | self.nextButton.connect_object("clicked", self.main, self.window.get_child()) self.quizWidget['stop'].hide() def options(self, oldbox): | def getUnrecmsg(kind): """Return a ready-to-display string which indicates the unrecognized kana (by kind) during the quiz. """ plop = "" for key,val in results[3][kind].items(): for x in val: if key!=1: plop += "%s (%s), " % (x.upper(),key) else: plop += "%s, " % x.upper() return "\n%s" % msg(72+kind) % plop[:-2] | 64cfb9e0b60a3a976c72fa9d5d722987641133b9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3073/64cfb9e0b60a3a976c72fa9d5d722987641133b9/gtk_gui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10833,
3927,
3576,
12,
9224,
4672,
3536,
990,
279,
5695,
17,
869,
17,
5417,
533,
1492,
8527,
326,
28333,
417,
13848,
261,
1637,
3846,
13,
4982,
326,
16479,
18,
225,
3536,
293,
16884,
273... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10833,
3927,
3576,
12,
9224,
4672,
3536,
990,
279,
5695,
17,
869,
17,
5417,
533,
1492,
8527,
326,
28333,
417,
13848,
261,
1637,
3846,
13,
4982,
326,
16479,
18,
225,
3536,
293,
16884,
273... |
assert map_type in ("Fo-Fc", "Fobs-Fmodel" | assert map_type in ("Fo-Fc", "Fobs-Fmodel", | def electron_density_map(self, map_type = "Fo-Fc", k = 1, n = 1, w1 = None, w2 = None, resolution_factor = 1/3., symmetry_flags = None): assert map_type in ("Fo-Fc", "Fobs-Fmodel" "2mFo-DFc", "2mFobs-DFmodel", "mFo-DFc", "mFobs-DFmodel", "gradient", "m_gradient") | d025e770363333be3e5e2c6b98cb208fef9c8f65 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/696/d025e770363333be3e5e2c6b98cb208fef9c8f65/twin_f_model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27484,
67,
18781,
67,
1458,
12,
2890,
16,
852,
67,
723,
1850,
273,
315,
42,
83,
17,
42,
71,
3113,
417,
1171,
273,
404,
16,
290,
1171,
273,
404,
16,
341,
21,
7734,
273,
599,
16,
341... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
27484,
67,
18781,
67,
1458,
12,
2890,
16,
852,
67,
723,
1850,
273,
315,
42,
83,
17,
42,
71,
3113,
417,
1171,
273,
404,
16,
290,
1171,
273,
404,
16,
341,
21,
7734,
273,
599,
16,
341... |
position = dim-i-1 | position = dim - i - 1 | def create_2D_dist(som,*args,**kwargs): """ This function takes a SOM of single spectrum with energy transfer axes and rebins those axes to a given axis and converts the spectra into a single I(Q,E) spectrum. Parameters: ---------- -> som is the input SOM with energy transfer axis SOs -> *args is a mandatory list of axes for rebinning. There is a particular order to them. They should be present in the following order: Without errors 1. Energy transfer 2. Momentum transfer With errors 1. Energy transfer 2. Energy transfer error^2 3. Momentum transfer 4. Momentum transfer error ^2 -> **kwargs is a dictionary of optional keywords that pass information to the function. Here are the currently accepted keywords: - withXVar=<string>. The string will either be True or False. If the keyword is not present, the default value will be False - data_type=<string> The string can be either histogram, density or coordinate. If the keyword is not present, the default value will be histogram - so_id=<identifier> The identifier represents a number, string, tuple or other object that describes the resulting SO - y_label=<string> This is a string that sets the y axis label - y_units=<string> This is a string that sets the y axis units - x_labels=<list of strings> This is a list of strings that sets the individual x axes labels - x_units=<list of string> This is a list of strings that sets the individual x axes units Returns: ------- <- A SOM with a single 2D SO with E and Q axes Exceptions: ---------- <- RuntimeError is raised if the parameter given to the keyword argument withXVar is not True or False <- RuntimeError is raised if the parameter given to the keyword argument data_type is not histogram or density or coordinate <- RuntimeError is raised is the number of given arguments (x-axes) is not either 2 (no errors) or 4 (with errors) """ import common_lib import hlr_utils import nessi_list import SOM # Setup some variables dim = 2 N_y = [] N_tot = 1 N_args = len(args) # Check withXVar keyword argument and also check number of given args. # Set xvar and Q_pos (position of the momentum transfer axis in the args # list) to the appropriate values try: value = kwargs["withXVar"] if value.lower() == "true": if N_args != 4: raise RuntimeError, "Since you have requested x errors, 4 x "\ +"axes must be provided." else: xvar = True Q_pos = 2 elif value.lower() == "false": if N_args != 2: raise RuntimeError, "Since you did not requested x errors, 2 "\ +"x axes must be provided." else: xvar = False Q_pos = 1 else: raise RuntimeError, "Do not understand given parameter %s" % \ value except KeyError: if N_args != 2: raise RuntimeError, "Since you did not requested x errors, 2 "\ +"x axes must be provided." else: xvar = False Q_pos = 1 # Check dataType keyword argument. An offset will be set to 1 for the # histogram type and 0 for either density or coordinate try: type = kwargs["data_type"] if type.lower() == "histogram": offset = 1 elif type.lower() == "density" or type.lower() == "coordinate": offset = 0 else: raise RuntimeError, "Do not understand data type given: %s" % \ type # Default is offset for histogram except KeyError: offset = 1 so_dim = SOM.SO(dim) for i in range(dim): # Set the x-axis arguments from the *args list into the new SO if not xvar: # Axis positions are 1 (Q) and 0 (E) position = dim-i-1 so_dim.axis[i].val = args[position] else: # Axis positions are 2 (Q), 3 (eQ), 0 (E), 1 (eE) position = dim-2*i so_dim.axis[i].val = args[position] so_dim.axis[i].var = args[position+1] # Set individual value axis sizes (not x-axis size) N_y.append(len(args[position]) - offset) # Calculate total 2D array size N_tot = N_tot * N_y[-1] # Create y and var_y lists from total 2D size so_dim.y = nessi_list.NessiList(N_tot) so_dim.var_y = nessi_list.NessiList(N_tot) # Rebin data to E axis som1 = common_lib.rebin_axis_1D(som, args[0]) som = None del som inst = som1.attr_list.instrument lambda_final = som1.attr_list["Wavelength_final"] import array_manip import axis_manip for i in range(hlr_utils.get_length(som1)): # Find Q for pixel so = hlr_utils.get_value(som1,i,"SOM","all") (angle,angle_err2) = hlr_utils.get_parameter("polar",so,inst) l_f = hlr_utils.get_special(lambda_final, so) (Q,Q_err2) = axis_manip.wavelength_to_scalar_Q(l_f[0], l_f[1], angle/2.0, angle_err2/2.0) # Find Q value in given momentum transfer axis index = -1 for j in range(N_y[0]): if Q >= args[Q_pos][j] and Q < args[Q_pos][j+1]: index = j break if index != -1: start = index * N_y[1] finish = (index + 1) * N_y[1] length = finish - start + 1 val = hlr_utils.get_value(som1, i, "SOM") err2 = hlr_utils.get_err2(som1, i, "SOM") (so_dim.y, so_dim.var_y) = array_manip.add_ncerr(so_dim.y, so_dim.var_y, val, err2, a_start=start, b_size=length) # If the Q value is not found in the given axis, do nothing and # continue else: pass # Check for so_id keyword argument if kwargs.has_key("so_id"): so_dim.id = kwargs["so_id"] else: so_dim.id = 0 comb_som = SOM.SOM() comb_som.copyAttributes(som1) # Check for y_label keyword argument if kwargs.has_key("y_label"): comb_som.setYLabel(kwargs["y_label"]) else: comb_som.setYLabel("Counts") # Check for y_units keyword argument if kwargs.has_key("y_units"): comb_som.setYUnits(kwargs["y_units"]) else: comb_som.setYUnits("Counts / THz A^-1") # Check for x_labels keyword argument if kwargs.has_key("x_labels"): comb_som.setAllAxisLabels(kwargs["x_labels"]) else: comb_som.setAllAxisLabels(["Momentum transfer","Energy transfer"]) # Check for x_units keyword argument if kwargs.has_key("x_units"): comb_som.setAllAxisUnits(kwargs["x_units"]) else: comb_som.setAllAxisUnits(["A^-1","THz"]) comb_som.append(so_dim) return comb_som | 8c0e478ff0fa2abc2e5d85a427bbaf1028f81580 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/8c0e478ff0fa2abc2e5d85a427bbaf1028f81580/hlr_create_2D_dist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
22,
40,
67,
4413,
12,
87,
362,
16,
14,
1968,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
434,
2202,
17970,
598,
12929,
7412,
6515,
471,
283,
11862,
5348,
6515,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
22,
40,
67,
4413,
12,
87,
362,
16,
14,
1968,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
279,
348,
1872,
434,
2202,
17970,
598,
12929,
7412,
6515,
471,
283,
11862,
5348,
6515,... |
sanitized_authors = [] def sanitize_rev_props( rev_props ): for k in rev_props.iterkeys(): if options.logs and k == 'svn:log': rev_props['svn:log'] = hash(rev_props['svn:log']) elif options.usernames and k == 'svn:author': author = rev_props['svn:author'] try: i = sanitized_authors.index(author) except ValueError: i = len(sanitized_authors) sanitized_authors.append(author) rev_props['svn:author'] = "author%s" % (i, ) elif k == 'svn:date': pass else: print "Couldn't sanitize %s: \"%s\"" % (k, rev_props[k]) return rev_props | def svndump_sanitize_cmdline( appname, args ): """ Parses the commandline and executes the sanitization. Usage: >>> svndump_sanitize_cmdline( sys.argv[0], sys.argv[1:] ) @type appname: string @param appname: Name of the application (used in help text). @type args: list( string ) @param args: Commandline arguments. @rtype: integer @return: Return code (0 = OK). """ usage = "usage: %s [options] source destination" % appname parser = OptionParser( usage=usage, version="%prog "+__version ) parser.add_option("-f", "--no-file-data", help="Do not sanitize file data. (Equivalent to --file-data=none.)", action="store_const", const="none", dest="file_data_method", default=True) parser.add_option("-m", "--file-data", help="Method to sanitize file data: whole, line, none. Default is whole.", type="choice", choices=["whole", "line", "none"], action="store", dest="file_data_method", default="whole") parser.add_option("-n", "--no-filenames", help="Do not sanitize filenames", action="store_false", dest="filenames", default=True) parser.add_option("-e", "--exclude-filename", help="Do not sanitize this filename. May be used multiple times.", action="append", dest="filename_excludes", default=None) parser.add_option("-u", "--no-usernames", help="Do not sanitize usernames", action="store_false", dest="usernames", default=True) parser.add_option("-l", "--no-logs", help="Do not sanitize log messages", action="store_false", dest="logs", default=True) random_salt = ''.join(["%02x" % (random.randrange(0,256), ) for x in range(8)]) parser.add_option("-s", "--salt", help="Specify the salt to use in hex", dest="salt", default=random_salt) global options (options, args) = parser.parse_args( args ) if len( args ) != 2: print "specify exactly one source and one destination dumpfile." return 1 global sanitize_salt sanitize_salt = salthex_to_salt(options.salt) sanitize_dump_file( args[0], args[1] ) return 0 | 67cfd8a81e93d89ac616d5c44142e2f7f03bd012 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13212/67cfd8a81e93d89ac616d5c44142e2f7f03bd012/sanitize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5893,
4880,
2801,
67,
20266,
67,
4172,
1369,
12,
22323,
16,
833,
262,
30,
3536,
2280,
2420,
326,
28305,
471,
11997,
326,
6764,
1588,
18,
225,
10858,
30,
225,
4080,
5893,
4880,
2801,
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,
5893,
4880,
2801,
67,
20266,
67,
4172,
1369,
12,
22323,
16,
833,
262,
30,
3536,
2280,
2420,
326,
28305,
471,
11997,
326,
6764,
1588,
18,
225,
10858,
30,
225,
4080,
5893,
4880,
2801,
67,
... | |
if level >= C_LOG_LEVEL: | if level <= C_LOG_LEVEL: | def log_cb(level, str, len): if level >= C_LOG_LEVEL: print str, | 255ad5714a02b66ebbc5d14e293bf49a33f9a4dc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8531/255ad5714a02b66ebbc5d14e293bf49a33f9a4dc/pjsua_app.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
67,
7358,
12,
2815,
16,
609,
16,
562,
4672,
309,
1801,
1648,
385,
67,
4842,
67,
10398,
30,
1172,
609,
16,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
613,
67,
7358,
12,
2815,
16,
609,
16,
562,
4672,
309,
1801,
1648,
385,
67,
4842,
67,
10398,
30,
1172,
609,
16,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
ntags = self.filectx('.hgtags', parent).data() | prevtags = self.filectx('.hgtags', parent).data() | def _tag(self, name, node, message, local, user, date, parent=None): use_dirstate = parent is None | 47fb34387cbd1873803508c186cec8c790145e01 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11312/47fb34387cbd1873803508c186cec8c790145e01/localrepo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2692,
12,
2890,
16,
508,
16,
756,
16,
883,
16,
1191,
16,
729,
16,
1509,
16,
982,
33,
7036,
4672,
999,
67,
72,
920,
340,
273,
982,
353,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
389,
2692,
12,
2890,
16,
508,
16,
756,
16,
883,
16,
1191,
16,
729,
16,
1509,
16,
982,
33,
7036,
4672,
999,
67,
72,
920,
340,
273,
982,
353,
599,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
settings = OptionParser([LaTeXWriter()]).get_default_values() document.settings = settings | if self.settings is None: settings = OptionParser([LaTeXWriter()]).get_default_values() self.__class__.settings = settings document.settings = self.settings | def __init__(self, document, docstring_linker): # Set the document's settings. settings = OptionParser([LaTeXWriter()]).get_default_values() document.settings = settings | 70500a033ec182a68bee32d8294a4a46d60a27ce /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/70500a033ec182a68bee32d8294a4a46d60a27ce/restructuredtext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1668,
16,
14525,
67,
1232,
264,
4672,
468,
1000,
326,
1668,
1807,
1947,
18,
1947,
273,
18862,
3816,
30745,
21575,
60,
2289,
1435,
65,
2934,
588,
67,
1886,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
1668,
16,
14525,
67,
1232,
264,
4672,
468,
1000,
326,
1668,
1807,
1947,
18,
1947,
273,
18862,
3816,
30745,
21575,
60,
2289,
1435,
65,
2934,
588,
67,
1886,
... |
keep_elem_refs(pObject, item, mode, iitem, uimode) _fl_set_choice_item_mode(pObject, iitem, uimode) | keep_elem_refs(pObject, itemnum, mode, iitemnum, uimode) _fl_set_choice_item_mode(pObject, iitemnum, uimode) | def fl_set_choice_item_mode(pObject, itemnum, mode): """ fl_set_choice_item_mode(pObject, itemnum, mode) Sets the mode of an item in a choice object. @param pObject : pointer to choice object @param itemnum : item number whose mode is to be set @param mode : mode of item """ _fl_set_choice_item_mode = cfuncproto( load_so_libforms(), "fl_set_choice_item_mode", None, [cty.POINTER(FL_OBJECT), cty.c_int, cty.c_uint], """void fl_set_choice_item_mode(FL_OBJECT * ob, int item, unsigned int mode) """) iitem = convert_to_int(item) uimode = convert_to_uint(mode) keep_elem_refs(pObject, item, mode, iitem, uimode) _fl_set_choice_item_mode(pObject, iitem, uimode) | 1aca4c2386840b1a264bbd12036b2a8e81ad73f5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/1aca4c2386840b1a264bbd12036b2a8e81ad73f5/library.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
11569,
67,
1726,
67,
3188,
12,
84,
921,
16,
761,
2107,
16,
1965,
4672,
3536,
1183,
67,
542,
67,
11569,
67,
1726,
67,
3188,
12,
84,
921,
16,
761,
2107,
16,
1965,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
542,
67,
11569,
67,
1726,
67,
3188,
12,
84,
921,
16,
761,
2107,
16,
1965,
4672,
3536,
1183,
67,
542,
67,
11569,
67,
1726,
67,
3188,
12,
84,
921,
16,
761,
2107,
16,
1965,
... |
sage: sage: K(O.1^2 + O.1 - 2) | sage: K(O.1^2 + O.1 - 2) | def __call__(self, x): """ Create an element of this cyclotomic field from $x$. EXAMPLES: The following example illustrates coercion from the cyclotomic field Q(zeta_42) to the cyclotomic field Q(zeta_6), in a case where such coercion is defined: sage: k42 = CyclotomicField(42) sage: k6 = CyclotomicField(6) sage: a = k42.gen(0) sage: b = a^7 sage: b zeta42^7 sage: k6(b) zeta6 sage: b^2 zeta42^7 - 1 sage: k6(b^2) zeta6 - 1 | f513df589049562f6080840f6924d0c7d44a004f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/f513df589049562f6080840f6924d0c7d44a004f/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
619,
4672,
3536,
1788,
392,
930,
434,
333,
6143,
830,
352,
24721,
652,
628,
271,
92,
8,
18,
225,
5675,
8900,
11386,
30,
1021,
3751,
3454,
277,
2906,
2700... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
619,
4672,
3536,
1788,
392,
930,
434,
333,
6143,
830,
352,
24721,
652,
628,
271,
92,
8,
18,
225,
5675,
8900,
11386,
30,
1021,
3751,
3454,
277,
2906,
2700... |
res = self.__checkArgumentFormat(userDN) | res = self.__checkArgumentFormat( userDN ) | def createUserMapping(self,userDN): """ Create a user with the supplied DN and return the userID """ res = self.__checkArgumentFormat(userDN) if not res['OK']: return res userDNs = res['Value'] successful = {} failed = {} created = self.__openSession() for userDN,uid in userDNs.items(): if not uid: uid = -1 res = self.__addUserDN(uid,userDN) if not res['OK']: failed[userDN] = res['Message'] else: res = self.__getDNUserID(userDN) if not res['OK']: failed[userDN] = res['Message'] else: successful[userDN] = res['Value'] if created: self.__closeSession() resDict = {'Failed':failed,'Successful':successful} return S_OK(resDict) | 6280f3782654b93320f684f56a83a6624459bcec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/6280f3782654b93320f684f56a83a6624459bcec/LcgFileCatalogClient.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22992,
3233,
12,
2890,
16,
1355,
8609,
4672,
3536,
1788,
279,
729,
598,
326,
4580,
18001,
471,
327,
326,
16299,
3536,
400,
273,
365,
16186,
1893,
1379,
1630,
12,
729,
8609,
262,
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,
22992,
3233,
12,
2890,
16,
1355,
8609,
4672,
3536,
1788,
279,
729,
598,
326,
4580,
18001,
471,
327,
326,
16299,
3536,
400,
273,
365,
16186,
1893,
1379,
1630,
12,
729,
8609,
262,
309,
486... |
dist = pow(anyX-groupCenterX-rX,2) + pow(anyY-groupCenterY-rY,2) | dist = pow(anyX-(groupCenterX+rX+0.5),2) + pow(anyY-(groupCenterY+rY+0.5),2) | def precompute(self): # clear active areas for buoy texts self._actBuoyAreas = {} player_highlight = -1 if gdata.config.game.highlight != None: player_highlight = gdata.config.game.highlight self._map = { self.MAP_SCANNER1: [], self.MAP_SYSTEMS: [], self.MAP_PLANETS: [], self.MAP_FLEETS: [], self.MAP_FORDERS: [], self.MAP_OTHERS: [], self.MAP_FREDIRECTS: [], self.MAP_GATENETWORK: [], self.MAP_GATESYSTEMS: [], self.MAP_CONTROLAREA: {} } self._popupInfo = {} self._fleetRanges = {} # find all pirate planets pirates = {} log.debug("Checking pirate planets and wormholes") for objID in client.db.keys(): if objID < OID_FREESTART: continue obj = client.get(objID, noUpdate = 1) if not hasattr(obj, "type"): continue if obj.type == T_WORMHOLE and not hasattr(obj, 'destinationOid'): obj = client.get(objID, forceUpdate = 1, publicOnly = 1) if obj.type == T_PLANET and hasattr(obj, "x"): ownerID = getattr(obj, 'owner', OID_NONE) if ownerID == OID_NONE: continue owner = client.get(ownerID, publicOnly = 1) if hasattr(owner, "type") and owner.type == T_PIRPLAYER: pirates[obj.x, obj.y] = None # process objects self.fleetOrbit = {} anyX = 0.0 anyY = 0.0 player = client.getPlayer() for objID in client.db.keys(): if objID < OID_FREESTART: continue obj = client.get(objID, noUpdate = 1) if not hasattr(obj, "type"): continue try: if obj.type == T_PLAYER: continue if hasattr(obj, "x"): anyX = obj.x if hasattr(obj, "y"): anyY = obj.y except AttributeError, e: log.warning('StarMapWidget', 'Cannot render objID = %d' % objID) continue if obj.type == T_SYSTEM: img = res.getSmallStarImg(obj.starClass[1]) # TODO correct me icons = [] name = getattr(obj, 'name', None) # TODO compute real relationship #rel = REL_UNDEF refuelMax = 0 refuelInc = 0 hasRefuel = False upgradeShip = 0 repairShip = 0 speedBoost = 0 moraleCount = 0 morale = 200 minerals = -1 bio = -1 slots = 0 numPlanets = 0 stratRes = SR_NONE #owner2 = 0 ownerID = OID_NONE explored = False if hasattr(obj, 'planets'): hasPirate = False for planetID in obj.planets: planet = client.get(planetID, noUpdate = 1) owner = getattr(planet, 'owner', OID_NONE) if hasattr(planet, "plType") and planet.plType not in ("A", "G"): numPlanets += 1 if hasattr(planet, "plMin"): minerals = max(minerals,planet.plMin) if hasattr(planet, "plBio"): bio = max(bio,planet.plBio) if hasattr(planet, "plSlots"): slots += planet.plSlots if hasattr(planet, "plStratRes") and planet.plStratRes != SR_NONE: stratRes = planet.plStratRes stratRes = planet.plStratRes icons.append(res.icons["sr_%d" % planet.plStratRes]) if owner: ownerID = owner if hasattr(planet, "morale"): morale = min(morale,planet.morale) if hasattr(planet, "refuelMax"): refuelMax = max(refuelMax, planet.refuelMax) refuelInc = max(refuelInc, planet.refuelInc) if hasattr(planet, "repairShip"): upgradeShip += planet.upgradeShip repairShip = max(repairShip, planet.repairShip) hasRefuel = hasRefuel or getattr(planet, 'hasRefuel', False) if hasattr(planet, "fleetSpeedBoost"): speedBoost = max(speedBoost, planet.fleetSpeedBoost) # uncharted system if hasattr(planet, 'plBio') and hasattr(planet, 'plEn'): explored = True if not explored and name != None: name = "[%s]" % (name) #if moraleCount > 0: # morale = morale/moraleCount if morale==200: morale = -1 pirProb = self.precomputePirates(obj, pirates, icons) # refuelling if refuelMax > 0: if refuelMax >= 87: icons.append(res.icons["fuel_99"]) elif refuelMax >= 62: icons.append(res.icons["fuel_75"]) elif refuelMax >= 37: icons.append(res.icons["fuel_50"]) elif refuelMax >= 12: icons.append(res.icons["fuel_25"]) elif hasRefuel: icons.append(res.icons["fuel_-"]) # repair and upgrade if upgradeShip > 10 and repairShip > 0.02: icons.append(res.icons["rep_10"]) elif upgradeShip > 0 and repairShip > 0: icons.append(res.icons["rep_1"]) | ac2e7fdec91df6f5ec4013a47de64d58cbeb3c83 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/503/ac2e7fdec91df6f5ec4013a47de64d58cbeb3c83/StarMapWidget.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
675,
9200,
12,
2890,
4672,
468,
2424,
2695,
15586,
364,
25666,
13372,
15219,
365,
6315,
621,
38,
89,
13372,
28377,
273,
2618,
7291,
67,
15978,
273,
300,
21,
309,
314,
892,
18,
1425,
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,
675,
9200,
12,
2890,
4672,
468,
2424,
2695,
15586,
364,
25666,
13372,
15219,
365,
6315,
621,
38,
89,
13372,
28377,
273,
2618,
7291,
67,
15978,
273,
300,
21,
309,
314,
892,
18,
1425,
18,
... |
""" Manages loading NumPy packages. | """ Manages loading packages. | def __init__(self, verbose=False): """ Manages loading NumPy packages. """ | 5d495dd5e9c3f1d2311a3a860a11c7d220f18e8d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14925/5d495dd5e9c3f1d2311a3a860a11c7d220f18e8d/_import_tools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3988,
33,
8381,
4672,
3536,
490,
940,
281,
7153,
5907,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
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,
3988,
33,
8381,
4672,
3536,
490,
940,
281,
7153,
5907,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
* itools.uri -- an API to manage URIs, to identify and locate resources. * itools.schema -- several type marshalers for basic types (integer, date, etc.) and not so basic types (filenames, XML qualified names, etc.) * itools.resources -- an abstraction layer over resources that let to manage them with a consistent API, independently of where they are stored. * itools.handlers -- resource handlers infrastructure (resource handlers are non persistent classes that add specific semantics to resources). This package also includes several handlers out of the box. * itools.gettext -- resource handlers for PO and MO files. * itools.xml -- includes an intuitive event driven XML parser, a handler for XML documents, and the Simple Template Language. * itools.xhtml -- resource handlers for XHTML documents. * itools.html -- resource handlers for HTML documents. * itools.i18n -- tools for language negotiation and text segmentation. * itools.workflow -- represent workflows as automatons, objects can move from one state to another through transitions, classes can add specific semantics to states and transitions. * itools.catalog -- An Index & Search engine. | - itools.catalog - itools.datatypes - itools.gettext - itools.handlers - itools.html - itools.i18n - itools.ical - itools.resources - itools.rss - itools.schemas - itools.tmx - itools.uri - itools.web - itools.workflow - itools.xhtml - itools.xliff - itools.xml | def finalize_options (self): self.set_undefined_options('install', ('install_purelib', 'install_dir'), ('root', 'root'), ('force', 'force'), ) | 5a6ec107366afa260d2d078099d28e46810baf2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12681/5a6ec107366afa260d2d078099d28e46810baf2d/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12409,
67,
2116,
261,
2890,
4672,
365,
18,
542,
67,
5978,
67,
2116,
2668,
5425,
2187,
7707,
5425,
67,
84,
594,
2941,
2187,
296,
5425,
67,
1214,
19899,
7707,
3085,
2187,
296,
3085,
19899,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12409,
67,
2116,
261,
2890,
4672,
365,
18,
542,
67,
5978,
67,
2116,
2668,
5425,
2187,
7707,
5425,
67,
84,
594,
2941,
2187,
296,
5425,
67,
1214,
19899,
7707,
3085,
2187,
296,
3085,
19899,... |
<code> | <pre class="code"> | def path (self): """ Return the WMI URI to this object. Can be used to determine the path relative to the parent namespace. eg, | 33b6afeb09b0fb0f6979802bcea6210277916dda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1886/33b6afeb09b0fb0f6979802bcea6210277916dda/wmi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
589,
261,
2890,
4672,
3536,
2000,
326,
678,
7492,
3699,
358,
333,
733,
18,
4480,
506,
1399,
358,
4199,
326,
589,
3632,
358,
326,
982,
1981,
18,
9130,
16,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
589,
261,
2890,
4672,
3536,
2000,
326,
678,
7492,
3699,
358,
333,
733,
18,
4480,
506,
1399,
358,
4199,
326,
589,
3632,
358,
326,
982,
1981,
18,
9130,
16,
2,
-100,
-100,
-100,
-100,
-10... |
k,v = line.split(':') | k,v = line.decode('ascii').split(':') | def refresh(self): """Refresh all outdated VM keys by reading /proc/<pid>/status.""" if self.verbose>=1: print 'MemoryBase.refresh' | 7128a93432365d82a277c580181242b3afc70c62 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5572/7128a93432365d82a277c580181242b3afc70c62/memory.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
12,
2890,
4672,
3536,
8323,
777,
25629,
8251,
1311,
635,
6453,
342,
9381,
28177,
6610,
16893,
2327,
12123,
309,
365,
18,
11369,
34,
33,
21,
30,
1172,
296,
6031,
2171,
18,
9144,
11,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
12,
2890,
4672,
3536,
8323,
777,
25629,
8251,
1311,
635,
6453,
342,
9381,
28177,
6610,
16893,
2327,
12123,
309,
365,
18,
11369,
34,
33,
21,
30,
1172,
296,
6031,
2171,
18,
9144,
11,... |
cr.execute("""select account_analytic_line.account_id,sum(amount) \ | cr.execute("""select account_analytic_line.account_id,COALESCE(sum(amount),0.0) \ | def _total_cost_calc(self, cr, uid, ids, name, arg, context={}): res = {} ids2 = self.search(cr, uid, [('parent_id', 'child_of', ids)]) if ids2: acc_set = ",".join(map(str, ids2)) cr.execute("""select account_analytic_line.account_id,sum(amount) \ from account_analytic_line \ join account_analytic_journal \ on account_analytic_line.journal_id = account_analytic_journal.id \ where account_analytic_line.account_id IN (%s) \ and amount<0 \ GROUP BY account_analytic_line.account_id"""%acc_set) for account_id, sum in cr.fetchall(): res[account_id] = round(sum,2) for obj_id in ids: res.setdefault(obj_id, 0.0) for child_id in self.search(cr, uid, [('parent_id', 'child_of', [obj_id])]): if child_id != obj_id: res[obj_id] += res.get(child_id, 0.0) for id in ids: res[id] = round(res.get(id, 0.0),2) return res | dc48d4a5caeb9fdf64002edf18659545571abaa7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8241/dc48d4a5caeb9fdf64002edf18659545571abaa7/account_analytic_analysis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4963,
67,
12398,
67,
12448,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
12938,
4672,
400,
273,
2618,
3258,
22,
273,
365,
18,
3072,
12,
3353,
16,
4555,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4963,
67,
12398,
67,
12448,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
508,
16,
1501,
16,
819,
12938,
4672,
400,
273,
2618,
3258,
22,
273,
365,
18,
3072,
12,
3353,
16,
4555,
16... |
ndata = TimestampedNotificationData(context=context, failure=Failure(), reason='SIP session ended before media could initialize') | ndata = TimestampedNotificationData(context='initialize', failure=Failure(), reason='SIP session ended before media could initialize') | def initialize(self, session, direction): self.greenlet = api.getcurrent() notification_center = NotificationCenter() notification_center.add_observer(self, sender=self) try: self.session = session outgoing = direction=='outgoing' if isinstance(self.account, Account) and (outgoing and self.account.nat_traversal.use_msrp_relay_for_outbound) or (not outgoing and self.account.nat_traversal.use_msrp_relay_for_inbound): credentials = self.account.credentials if self.account.nat_traversal.msrp_relay is None: relay = MSRPRelaySettings(domain=self.account.uri.host, username=self.account.uri.user, password=credentials.password if credentials else '', use_tls=self.account.msrp.transport=='tls') self.transport = self.account.msrp.transport else: relay = MSRPRelaySettings(domain=self.account.uri.host, username=self.account.uri.user, password=credentials.password if credentials else '', host=self.account.nat_traversal.msrp_relay.host, port=self.account.nat_traversal.msrp_relay.port, use_tls=self.account.nat_traversal.msrp_relay.transport=='tls') self.transport = self.account.nat_traversal.msrp_relay.transport if self.transport != self.account.msrp.transport: raise MSRPStreamError("MSRP relay transport conflicts with MSRP transport setting") else: relay = None self.transport = self.account.msrp.transport if not outgoing and relay is None and self.transport == 'tls' and None in (self.account.tls_credentials.cert, self.account.tls_credentials.key): raise MSRPStreamError("cannot create incoming MSRP stream without a certificate and private key") logger = NotificationProxyLogger() self.msrp_connector = get_connector(relay=relay, logger=logger) if outgoing else get_acceptor(relay=relay, logger=logger) local_uri = URI(host=host.default_ip, port=0, use_tls=self.transport=='tls', credentials=self.account.tls_credentials) full_local_path = self.msrp_connector.prepare(local_uri) self.local_media = self._create_local_media(full_local_path) except api.GreenletExit: ndata = TimestampedNotificationData(context=context, failure=Failure(), reason='SIP session ended before media could initialize') notification_center.post_notification('MediaStreamDidFail', self, ndata) raise except Exception, ex: ndata = TimestampedNotificationData(context='initialize', failure=Failure(), reason=str(ex)) notification_center.post_notification('MediaStreamDidFail', self, ndata) else: notification_center.post_notification('MediaStreamDidInitialize', self, data=TimestampedNotificationData()) finally: if self.msrp_session is None and self.msrp is None and self.msrp_connector is None: notification_center.remove_observer(self, sender=self) self.greenlet = None | e5158d4d468be4361da29e82b3a7f53126138be8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5703/e5158d4d468be4361da29e82b3a7f53126138be8/msrp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
1339,
16,
4068,
4672,
365,
18,
11571,
1810,
273,
1536,
18,
588,
2972,
1435,
3851,
67,
5693,
273,
8050,
8449,
1435,
3851,
67,
5693,
18,
1289,
67,
30971,
12,
2890,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4046,
12,
2890,
16,
1339,
16,
4068,
4672,
365,
18,
11571,
1810,
273,
1536,
18,
588,
2972,
1435,
3851,
67,
5693,
273,
8050,
8449,
1435,
3851,
67,
5693,
18,
1289,
67,
30971,
12,
2890,
16... |
MIN_WIDTH = 175 | MIN_WIDTH = 25 | def is_opaque(self): return True | 41da3352dc967e17788691e1d84f8d7f8ef5681b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/41da3352dc967e17788691e1d84f8d7f8ef5681b/style.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
556,
14886,
12,
2890,
4672,
327,
1053,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
556,
14886,
12,
2890,
4672,
327,
1053,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
res = factory.getStorages('CERN-RAW', ['SRM2']) self.assert_(res['OK']) print res | res = factory.getStorages('IN2P3-RAW', ['SRM2']) self.assert_(res['OK']) storageDetails = res['Value'] self.storage = storageDetails['StorageObjects'][0] self.storage.changeDirectory('lhcb/test/unit-test') | def test_setUp(self): """ Create test storage """ factory = StorageFactory() res = factory.getStorages('CERN-RAW', ['SRM2']) self.assert_(res['OK']) print res | 0f206defd61d0db289ce8c6b27fadb88169f49e9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/0f206defd61d0db289ce8c6b27fadb88169f49e9/TestStoragePlugIn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
542,
1211,
12,
2890,
4672,
3536,
1788,
1842,
2502,
3536,
3272,
273,
5235,
1733,
1435,
400,
273,
3272,
18,
588,
510,
280,
1023,
2668,
39,
654,
50,
17,
10821,
2187,
10228,
55,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
67,
542,
1211,
12,
2890,
4672,
3536,
1788,
1842,
2502,
3536,
3272,
273,
5235,
1733,
1435,
400,
273,
3272,
18,
588,
510,
280,
1023,
2668,
39,
654,
50,
17,
10821,
2187,
10228,
55,
... |
self.recipe.ExcludeDirectories(exceptions=util.literalRegex(path)) | self.recipe.ExcludeDirectories(exceptions=util.literalRegex(path).replace('%', '%%')) | def chmod(self, destdir, path, mode=None): | 18777303521c30ba020574b0d3f0f043cb9d8a48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/18777303521c30ba020574b0d3f0f043cb9d8a48/build.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13413,
12,
2890,
16,
1570,
1214,
16,
589,
16,
1965,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13413,
12,
2890,
16,
1570,
1214,
16,
589,
16,
1965,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.rescan_nodes.add(r.exit_node[1:]) | self.rescan_nodes.add(r.exit_node) | def load_rescan(self, type, since=None): self.rescan_nodes = set([]) results = datahandler.getAll() for r in results: if r.status == type: if not since or r.timestamp >= since: self.rescan_nodes.add(r.exit_node[1:]) plog("INFO", "Loaded "+str(len(self.rescan_nodes))+" nodes to rescan") if self.nodes and self.rescan_nodes: self.nodes &= self.rescan_nodes self.scan_nodes = len(self.nodes) self.tests_per_node = num_rescan_tests_per_node self.nodes_to_mark = self.scan_nodes*self.tests_per_node | 1dcf3158851809a925b739e1b766022d46318a9d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3762/1dcf3158851809a925b739e1b766022d46318a9d/soat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
455,
4169,
12,
2890,
16,
618,
16,
3241,
33,
7036,
4672,
365,
18,
455,
4169,
67,
4690,
273,
444,
3816,
5717,
1686,
273,
501,
4176,
18,
588,
1595,
1435,
364,
436,
316,
1686,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
455,
4169,
12,
2890,
16,
618,
16,
3241,
33,
7036,
4672,
365,
18,
455,
4169,
67,
4690,
273,
444,
3816,
5717,
1686,
273,
501,
4176,
18,
588,
1595,
1435,
364,
436,
316,
1686,
... |
+ "<tr class='orig' id='.*?'>\n" + "\s*<td rowspan='2'>" | + "<tr class=('|\")orig('|\") id=('|\").*?('|\")>\n" + "\s*<td rowspan=('|\")2('|\")>" | def refresh_messages(site = None): site = site or wikipedia.getSite() # get 'all messages' special page's path path = site.allmessages_address() print 'Retrieving MediaWiki messages for %s' % repr(site) wikipedia.put_throttle() # It actually is a get, but a heavy one. allmessages = site.getUrl(path) print 'Parsing MediaWiki messages' # First group is MediaWiki key string. Second group is the current value string. if site.version() >= "1.8": itemR = re.compile('<tr class="def" id=".*?">' # first possibility: original MediaWiki message used + '\s*<td>' + '\s*<a id=".+?" name=".+?"></a>' # anchor + '\s*<a href=".+?" title=".+?"><span id=\".*?\">(?P<key>.+?)</span></a><br />' # message link + '\s*<a href=".+?"( class="new")? title=".+?">.+?</a>' # talk link + '\s*</td><td>' + '\s*(?P<current>.+?)' # current message + '\s*</td>' + '\s*</tr>' + '|' + '<tr class="orig" id=".*?">' # second possibility: custom message used + '\s*<td rowspan="2">' + '\s*<a id=".+?" name=".+?"></a>' # anchor + '\s*<a href=".+?" title=".+?"><span id=\".*?\">(?P<key2>.+?)</span></a><br />' # message link + '\s*<a href=".+?"( class="new")? title=".+?">.+?</a>' # talk link + '\s*</td><td>' + '\s*.+?' # original message + '\s*</td>' + '\s*</tr><tr class="new" id=".*?">' + '\s*<td>' + '\s*(?P<current2>.+?)' # current message + '\s*</td>' + '\s*</tr>', re.DOTALL) elif site.version() >= "1.5": # MediaWiki 1.5 had single quotation marks in some places. itemR = re.compile("<tr class='def' id='.*?'>\n" # first possibility: original MediaWiki message used + "\s*<td>\n" + '\s*<a id=".+?" name=".+?"></a>' # anchor + '\s*<a href=".+?" title=".+?"><span id=\'.*?\'>(?P<key>.+?)</span><\/a><br \/>' # message link + '\s*<a href=".+?" title=".+?">.+?<\/a>\n' # talk link + "\s*</td><td>" + "\s*(?P<current>.+?)\n" # current message + "\s*</td>" + "\s*</tr>" + "|" + "<tr class='orig' id='.*?'>\n" # second possibility: custom message used + "\s*<td rowspan='2'>" + '\s*<a id=".+?" name=".+?"></a>' # anchor + '\s*<a href=".+?" title=".+?"><span id=\'.*?\'>(?P<key2>.+?)</span><\/a><br \/>' # message link + '\s*<a href=".+?" title=".+?">.+?<\/a>\n' # talk link + "\s*</td><td>" + "\s*.+?\n" # original message + "\s*</td>" + "\s*</tr><tr class='new' id='.*?'>" + "\s*<td>\n" + "\s*(?P<current2>.+?)\n" # current message + "\s*</td>" + "\s*</tr>", re.DOTALL) else: itemR = re.compile("<tr bgcolor=\"#[0-9a-f]{6}\"><td>\n" #+ "\s*(?:<script[^<>]+>[^<>]+<[^<>]+script>)?[^+<a href=.+?>(?P<key>.+?)<\/a><br \/>\n" + "\s*<a href=.+?>(?P<key>.+?)<\/a><br \/>\n" + "\s*<a href=.+?>.+?<\/a>\n" + "\s*</td><td>\n" + "\s*.+?\n" + "\s*</td><td>\n" + "\s*(?P<current>.+?)\n" + "\s*<\/td><\/tr>", re.DOTALL) # we will save the found key:value pairs here dictionary = {} for match in itemR.finditer(allmessages): # Key strings only contain ASCII characters, so we can use them as dictionary keys key = match.group('key') or match.group('key2') current = match.group('current') or match.group('current2') dictionary[key] = current # Save the dictionary to disk # The file is stored in the mediawiki_messages subdir. Create if necessary. if dictionary == {}: wikipedia.debugDump( 'MediaWiki_Msg', site, u'Error URL: '+unicode(path), allmessages ) sys.exit() else: f = open(makepath('mediawiki-messages/mediawiki-messages-%s-%s.dat' % (site.family.name, site.lang)), 'w') pickle.dump(dictionary, f) f.close() #print dictionary['addgroup'] #print dictionary['sitestatstext'] | 9990a92893576c297fae79a68b587675d0c19b2d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4404/9990a92893576c297fae79a68b587675d0c19b2d/mediawiki_messages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
6833,
12,
4256,
273,
599,
4672,
2834,
273,
2834,
578,
21137,
18,
588,
4956,
1435,
468,
336,
296,
454,
2743,
11,
4582,
1363,
1807,
589,
589,
273,
2834,
18,
454,
6833,
67,
2867... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4460,
67,
6833,
12,
4256,
273,
599,
4672,
2834,
273,
2834,
578,
21137,
18,
588,
4956,
1435,
468,
336,
296,
454,
2743,
11,
4582,
1363,
1807,
589,
589,
273,
2834,
18,
454,
6833,
67,
2867... |
solution.chmod = 0444 | def create_xcode_project(t): toolName = t.features[0] appname = getattr(Utils.g_module, 'APPNAME', 'noname') if not solutions.has_key(toolName): outname = 'project.pbxproj' solution = GenerateProject(env=t.env) solution.set_outputs(t.path.find_or_declare(outname)) solution.name = appname solution.version = xcodeprojects[toolName] solution.install_path = t.path.srcpath(t.env)+'/'+appname+'.'+toolName+'.xcodeproj/' solution.chmod = 0444 solution.projects = [] solution.dep_vars = ['XCODE_PROJECT_DEPENDS'] solution.env['XCODE_PROJECT_DEPENDS'] = [] solutions[toolName] = solution solution = solutions[toolName] project = Project() project.type = t.type #project.allplatforms = projects[toolName][2] project.platforms = t.platforms project.version = toolName project.projectCategory = t.category project.projectName = t.name project.type = t.type project.sourceTree = t.sourcetree project.usemaster = t.usemaster project.depends = t.depends if t.usemaster: filename = "master-%s.cpp" % t.name node = t.path.find_or_declare(filename) solution.set_outputs(node) project.masterfile = node project.masterfilename = os.path.join(appname+'.'+toolName+'.xcodeproj/', filename) solution.projects.append(project) solution.env['XCODE_PROJECT_DEPENDS'].append(t.sourcetree) | c73f2456ec51b2b4797d870c08f234ed68da574a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7302/c73f2456ec51b2b4797d870c08f234ed68da574a/xcode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
92,
710,
67,
4406,
12,
88,
4672,
5226,
461,
273,
268,
18,
7139,
63,
20,
65,
22323,
273,
3869,
12,
1989,
18,
75,
67,
2978,
16,
296,
7215,
1985,
2187,
296,
5836,
339,
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,
752,
67,
92,
710,
67,
4406,
12,
88,
4672,
5226,
461,
273,
268,
18,
7139,
63,
20,
65,
22323,
273,
3869,
12,
1989,
18,
75,
67,
2978,
16,
296,
7215,
1985,
2187,
296,
5836,
339,
6134,
... | |
self._data=BTree.BTree() | self._data=OOBTree.OOBTree() | def __init__(self, name='Demo Storage', base=None, quota=None): | 5f48194f0adf628155c6138a3fcde59d9ea65eb6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/5f48194f0adf628155c6138a3fcde59d9ea65eb6/DemoStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
2218,
27126,
5235,
2187,
1026,
33,
7036,
16,
13257,
33,
7036,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
2218,
27126,
5235,
2187,
1026,
33,
7036,
16,
13257,
33,
7036,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
amount = qty / from_uom.factor | amount = qty / from_uom.rate | def _compute_qty(self, cursor, user, from_uom_id, qty, to_uom=False): """ Convert quantity for given uom's. from_uom and to_uom should be browse records. """ if not from_uom or not qty or not to_uom: return qty if from_uom.category.id <> to_uom.category.id: return qty if from_uom.factor_data: amount = qty * from_uom.factor_data else: amount = qty / from_uom.factor if to_uom: if to_uom.factor_data: amount = rounding(amount / to_uom.factor_data, to_uom.rounding) else: amount = rounding(amount * to_uom.factor, to_uom.rounding) return amount | 4df7058a1bfea50026f1f02f1638f1b380528843 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/533/4df7058a1bfea50026f1f02f1638f1b380528843/uom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
9200,
67,
85,
4098,
12,
2890,
16,
3347,
16,
729,
16,
628,
67,
89,
362,
67,
350,
16,
26667,
16,
358,
67,
89,
362,
33,
8381,
4672,
3536,
4037,
10457,
364,
864,
582,
362,
1807,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
9200,
67,
85,
4098,
12,
2890,
16,
3347,
16,
729,
16,
628,
67,
89,
362,
67,
350,
16,
26667,
16,
358,
67,
89,
362,
33,
8381,
4672,
3536,
4037,
10457,
364,
864,
582,
362,
1807,
1... |
'.1.3.6.1.4.1.1916.2.62', | def handleEquipment(self, oid): return (oid in ['.1.3.6.1.4.1.1916.2.40', # Extreme Summit 24e '.1.3.6.1.4.1.1916.2.54', # Extreme Summit 48e '.1.3.6.1.4.1.1916.2.62', # Black Diamond 8810 '.1.3.6.1.4.1.1916.2.76', # Extreme Summit 48t ]) | 0f22d078d92418f98427927848bd42157142046e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13050/0f22d078d92418f98427927848bd42157142046e/extreme.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
13142,
11568,
12,
2890,
16,
7764,
4672,
327,
261,
839,
316,
10228,
18,
21,
18,
23,
18,
26,
18,
21,
18,
24,
18,
21,
18,
3657,
2313,
18,
22,
18,
7132,
2187,
468,
6419,
2764,
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,
1640,
13142,
11568,
12,
2890,
16,
7764,
4672,
327,
261,
839,
316,
10228,
18,
21,
18,
23,
18,
26,
18,
21,
18,
24,
18,
21,
18,
3657,
2313,
18,
22,
18,
7132,
2187,
468,
6419,
2764,
73... | |
usingSubLanguageBackgroundColors = True | def applyScheme(self, scimoz, language, encoding, alternateType): registryService = components.classes['@activestate.com/koLanguageRegistryService;1'].\ getService(components.interfaces.koILanguageRegistryService) languageObj = registryService.getLanguage(language) # Don't worry about document-specific lexers. if languageObj: lexer = languageObj.getLanguageService(components.interfaces.koILexerLanguageService) lexer.setCurrent(scimoz) scimoz.styleBits = languageObj.styleBits self.currentLanguage = language self.currentEncoding = encoding self._appliedData = {} setters = { 'fore': scimoz.styleSetFore, 'back': scimoz.styleSetBack, 'bold': scimoz.styleSetBold, 'italic': scimoz.styleSetItalic, 'size': scimoz.styleSetSize, 'eolfilled': scimoz.styleSetEOLFilled, 'hotspot': scimoz.styleSetHotSpot, } | d8d56e083dd722a3c2821e6640dc66a5c69acb45 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9914/d8d56e083dd722a3c2821e6640dc66a5c69acb45/koScintillaSchemeService.p.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
9321,
12,
2890,
16,
888,
381,
11142,
16,
2653,
16,
2688,
16,
12184,
559,
4672,
4023,
1179,
273,
4085,
18,
4701,
3292,
36,
11422,
395,
340,
18,
832,
19,
28179,
3779,
4243,
1179,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2230,
9321,
12,
2890,
16,
888,
381,
11142,
16,
2653,
16,
2688,
16,
12184,
559,
4672,
4023,
1179,
273,
4085,
18,
4701,
3292,
36,
11422,
395,
340,
18,
832,
19,
28179,
3779,
4243,
1179,
3... | |
""" | If you pass a vector, it is assumed to be the coordinate vector of a point:: sage: P = Polyhedron(vertices=[[1,1],[1,-1],[-1,1],[-1,-1]]) sage: p = vector(ZZ, [1,0] ) sage: [ ieq.interior_contains(p) for ieq in P.inequality_generator() ] [True, True, True, False] """ try: if Vobj.is_vector(): return self.polyhedron()._is_positive( self.eval(Vobj) ) except AttributeError: pass | def interior_contains(self, Vobj): """ Tests whether the interior of the halfspace (excluding its boundary) defined by the inequality contains the given vertex/ray/line. | 84c90f627aa2eefd601a2ae3a4ad63f4e91ac1cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/84c90f627aa2eefd601a2ae3a4ad63f4e91ac1cc/polyhedra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26230,
67,
12298,
12,
2890,
16,
776,
2603,
4672,
225,
971,
1846,
1342,
279,
3806,
16,
518,
353,
12034,
358,
506,
326,
7799,
3806,
434,
279,
1634,
2866,
225,
272,
410,
30,
453,
273,
183... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26230,
67,
12298,
12,
2890,
16,
776,
2603,
4672,
225,
971,
1846,
1342,
279,
3806,
16,
518,
353,
12034,
358,
506,
326,
7799,
3806,
434,
279,
1634,
2866,
225,
272,
410,
30,
453,
273,
183... |
why = os.strerror(err.errno) | why = _strerror(err) | def ftp_RETR(self, line): """Retrieve the specified file (transfer from the server to the client) """ file = self.fs.translate(line) | e155be2e9b3e40d9bd92788d2569c640df5f0b57 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7236/e155be2e9b3e40d9bd92788d2569c640df5f0b57/ftpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13487,
67,
862,
4349,
12,
2890,
16,
980,
4672,
3536,
5767,
326,
1269,
585,
261,
13866,
628,
326,
1438,
358,
326,
1004,
13,
3536,
585,
273,
365,
18,
2556,
18,
13929,
12,
1369,
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,
13487,
67,
862,
4349,
12,
2890,
16,
980,
4672,
3536,
5767,
326,
1269,
585,
261,
13866,
628,
326,
1438,
358,
326,
1004,
13,
3536,
585,
273,
365,
18,
2556,
18,
13929,
12,
1369,
13,
2,
... |
def __getResourceRequirements(self): | def __getResourceRequirements( self ): | def __getResourceRequirements(self): """Adds resource requirements to the ClassAd. """ reqtSection = '/AgentJobRequirements' result = gConfig.getOptionsDict(reqtSection) if not result['OK']: self.log.warn(result['Message']) return S_OK(result['Message']) reqsDict = result['Value'] self.ceRequirementDict.update( reqsDict ) | 3d103a1ec7530dcfac38e6ccc642be862e663b73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/3d103a1ec7530dcfac38e6ccc642be862e663b73/ComputingElement.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1420,
15465,
12,
365,
262,
30,
3536,
3655,
1058,
8433,
358,
326,
1659,
1871,
18,
3536,
1111,
88,
5285,
273,
1173,
3630,
2278,
15465,
11,
563,
273,
314,
809,
18,
588,
1320,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
1420,
15465,
12,
365,
262,
30,
3536,
3655,
1058,
8433,
358,
326,
1659,
1871,
18,
3536,
1111,
88,
5285,
273,
1173,
3630,
2278,
15465,
11,
563,
273,
314,
809,
18,
588,
1320,
5... |
self.driver = WebDriver.WebDriver(WEBDRIVER_SERVER_URL, "chrome", "ANY"); | self.driver = WebDriver.WebDriver(WEBDRIVER_SERVER_URL, "chrome", "ANY") | def setUp(self): global WEBDRIVER_SERVER_URL global WEBDRIVER_PROCESS WEBDRIVER_PROCESS = subprocess.Popen([WEBDRIVER_EXE, '--port=%d' % WEBDRIVER_PORT]) if WEBDRIVER_PROCESS == None: print "Chromium executable not found. The path used was: " print WEBDRIVER_EXE sys.exit(-1) | d551cdcc3c87e382d24d1912fc41c6489bb0bd40 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/d551cdcc3c87e382d24d1912fc41c6489bb0bd40/webdriver_remote_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
2552,
13880,
18096,
20078,
67,
4370,
67,
1785,
2552,
13880,
18096,
20078,
67,
16560,
13880,
18096,
20078,
67,
16560,
273,
6652,
18,
52,
3190,
3816,
14778,
27720,
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,
24292,
12,
2890,
4672,
2552,
13880,
18096,
20078,
67,
4370,
67,
1785,
2552,
13880,
18096,
20078,
67,
16560,
13880,
18096,
20078,
67,
16560,
273,
6652,
18,
52,
3190,
3816,
14778,
27720,
67,
... |
def SR(n=1,r=1,c=1,e=4, star=False, **kwargs): | def SR(n=1, r=1, c=1, e=4, star=False, **kwargs): | def SR(n=1,r=1,c=1,e=4, star=False, **kwargs): """ Return a small scale variant of the AES polynomial system constructor subject to the following conditions: INPUT: n -- the number of rounds (default: 1) r -- the number of rows in the state array (default: 1) c -- the number of columns in the state array (default: 1) e -- the exponent of the finite extension field (default: 4) star -- determines if SR* or SR should be constructed (default: False) aes_mode -- as the SR key schedule specification differs slightly from the AES key schedule this parameter controls which schedule to use (default: True) gf2 -- generate polynomial systems over $\GF(2)$ rather than over $\GF(2^n)$ (default: False) order -- a string to specify the term ordering of the variables postfix -- a string which is appended after the variable name (default: '') allow_zero_inversions -- a boolean to controll whether zero inversions raise an exception (default: False) correct_only -- only include correct inversion polynomials (default: False, GF2 only) biaffine_only -- only include bilinear and biaffine inversion polynomials (default: True, GF2 only) EXAMPLES: sage: sr = mq.SR(1,1,1,4) sage: ShiftRows = sr.shift_rows_matrix() sage: MixColumns = sr.mix_columns_matrix() sage: Lin = sr.lin_matrix() sage: M = MixColumns * ShiftRows * Lin sage: print sr.hex_str_matrix(M) 5 1 C 5 2 2 1 F A 4 4 1 1 8 3 3 sage: sr = mq.SR(1,2,1,4) sage: ShiftRows = sr.shift_rows_matrix() sage: MixColumns = sr.mix_columns_matrix() sage: Lin = sr.lin_matrix() sage: M = MixColumns * ShiftRows * Lin sage: print sr.hex_str_matrix(M) F 3 7 F A 2 B A A A 5 6 8 8 4 9 7 8 8 2 D C C 3 4 6 C C 5 E F F A 2 B A F 3 7 F 8 8 4 9 A A 5 6 D C C 3 7 8 8 2 5 E F F 4 6 C C sage: sr = mq.SR(1,2,2,4) sage: ShiftRows = sr.shift_rows_matrix() sage: MixColumns = sr.mix_columns_matrix() sage: Lin = sr.lin_matrix() sage: M = MixColumns * ShiftRows * Lin sage: print sr.hex_str_matrix(M) F 3 7 F 0 0 0 0 0 0 0 0 A 2 B A A A 5 6 0 0 0 0 0 0 0 0 8 8 4 9 7 8 8 2 0 0 0 0 0 0 0 0 D C C 3 4 6 C C 0 0 0 0 0 0 0 0 5 E F F A 2 B A 0 0 0 0 0 0 0 0 F 3 7 F 8 8 4 9 0 0 0 0 0 0 0 0 A A 5 6 D C C 3 0 0 0 0 0 0 0 0 7 8 8 2 5 E F F 0 0 0 0 0 0 0 0 4 6 C C 0 0 0 0 A 2 B A F 3 7 F 0 0 0 0 0 0 0 0 8 8 4 9 A A 5 6 0 0 0 0 0 0 0 0 D C C 3 7 8 8 2 0 0 0 0 0 0 0 0 5 E F F 4 6 C C 0 0 0 0 0 0 0 0 F 3 7 F A 2 B A 0 0 0 0 0 0 0 0 A A 5 6 8 8 4 9 0 0 0 0 0 0 0 0 7 8 8 2 D C C 3 0 0 0 0 0 0 0 0 4 6 C C 5 E F F 0 0 0 0 """ if not kwargs.get("gf2",False): return SR_gf2n(n,r,c,e,star,**kwargs) else: return SR_gf2(n,r,c,e,star,**kwargs) | cd82551727ddbae04c5b28f55b59ec14654a84ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/cd82551727ddbae04c5b28f55b59ec14654a84ab/sr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19145,
12,
82,
33,
21,
16,
436,
33,
21,
16,
276,
33,
21,
16,
425,
33,
24,
16,
10443,
33,
8381,
16,
2826,
4333,
4672,
3536,
2000,
279,
5264,
3159,
5437,
434,
326,
15986,
16991,
2619,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19145,
12,
82,
33,
21,
16,
436,
33,
21,
16,
276,
33,
21,
16,
425,
33,
24,
16,
10443,
33,
8381,
16,
2826,
4333,
4672,
3536,
2000,
279,
5264,
3159,
5437,
434,
326,
15986,
16991,
2619,
... |
global generated generated = 0 | global generated generated = 0 | def onUnload(): global generated generated = 0 | b55c6bbef72ffa197cbeeffc47e620912acac324 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2534/b55c6bbef72ffa197cbeeffc47e620912acac324/add.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
984,
945,
13332,
2552,
4374,
4374,
273,
374,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
984,
945,
13332,
2552,
4374,
4374,
273,
374,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
tabCols=idleConf.GetOption('main','Indent','tab-cols', default=4,type='int') | def LoadTabCfg(self): ##indent type radibuttons spaceIndent=idleConf.GetOption('main','Indent','use-spaces', default=1,type='bool') self.indentBySpaces.set(spaceIndent) ##indent sizes spaceNum=idleConf.GetOption('main','Indent','num-spaces', default=4,type='int') tabCols=idleConf.GetOption('main','Indent','tab-cols', default=4,type='int') self.spaceNum.set(spaceNum) self.tabCols.set(tabCols) | 63f6714c3ab713767dc35abc2b1129a1d264d858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/63f6714c3ab713767dc35abc2b1129a1d264d858/configDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
5661,
8198,
12,
2890,
4672,
7541,
9355,
618,
6719,
495,
2644,
87,
3476,
7790,
33,
20390,
3976,
18,
967,
1895,
2668,
5254,
17023,
7790,
17023,
1202,
17,
9554,
2187,
805,
33,
21,
16,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4444,
5661,
8198,
12,
2890,
4672,
7541,
9355,
618,
6719,
495,
2644,
87,
3476,
7790,
33,
20390,
3976,
18,
967,
1895,
2668,
5254,
17023,
7790,
17023,
1202,
17,
9554,
2187,
805,
33,
21,
16,... | |
{1/6, 1/5, 1/3, 1/2, 11/30, 1/9, 2/3, 1/30, Infinity, 5/6, 1/45, 0, 1/18, 1/10, 1/15, 2/15} | {0, 1/3, 11/30, 5/6, 1/15, 1/10, 2/3, 1/9, Infinity, 1/2, 1/45, 1/18, 1/5, 2/15, 1/6, 1/30} | def _find_cusps(self): r""" Return a set of inequivalent cusps for self, i.e. a set of representatives for the orbits of self on $\mathbf{P}^1(\mathbf{Q})$. These are returned in a reduced form; see self.reduce_cusp for the definition of reduced. ALGORITHM: Uses explicit formulae specific to $\Gamma_0(N)$: a reduced cusp on $\Gamma_0(N)$ is always of the form $a/d$ where $d | N$, and $a_1/d \sim a_2/d$ if and only if $a_1 \cong a_2 \bmod {\rm gcd}(d, N/d)$. EXAMPLES: sage: Gamma0(90)._find_cusps() {1/6, 1/5, 1/3, 1/2, 11/30, 1/9, 2/3, 1/30, Infinity, 5/6, 1/45, 0, 1/18, 1/10, 1/15, 2/15} sage: Gamma0(1).cusps() {Infinity} sage: Gamma0(180).cusps() == Gamma0(180).cusps(algorithm='modsym') True """ N = self.level() s = [] for d in divisors(N): w = arith.gcd(d, N/d) if w == 1: if d == 1: s.append(cusps.Cusp(1,0)) elif d == N: s.append(cusps.Cusp(0,1)) else: s.append(cusps.Cusp(1,d)) else: for a in xrange(1, w): if arith.gcd(a, w) == 1: while arith.gcd(a, d/w) != 1: a += w s.append(cusps.Cusp(a,d)) return Set(s) | c51ec0e30959829b530242dd6f31ebc27e35f74b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/c51ec0e30959829b530242dd6f31ebc27e35f74b/congroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
71,
407,
1121,
12,
2890,
4672,
436,
8395,
2000,
279,
444,
434,
316,
14298,
6505,
27964,
1121,
364,
365,
16,
277,
18,
73,
18,
279,
444,
434,
2406,
8785,
364,
326,
578,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4720,
67,
71,
407,
1121,
12,
2890,
4672,
436,
8395,
2000,
279,
444,
434,
316,
14298,
6505,
27964,
1121,
364,
365,
16,
277,
18,
73,
18,
279,
444,
434,
2406,
8785,
364,
326,
578,
... |
vo = gConfig.getValue('/DIRAC/VirtualOrganization', 'lhcb') | vo = DIRAC.gConfig.getValue('/DIRAC/VirtualOrganization', 'lhcb') | def usage(): print 'Usage: %s ce' %(Script.scriptName) DIRAC.exit(2) | f8659943548ac35b75c8a0c19555a625e34b8d0a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/f8659943548ac35b75c8a0c19555a625e34b8d0a/dirac-admin-bdii-ce-voview.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
5898,
11,
8975,
3651,
18,
4263,
461,
13,
18544,
2226,
18,
8593,
12,
22,
13,
225,
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,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
5898,
11,
8975,
3651,
18,
4263,
461,
13,
18544,
2226,
18,
8593,
12,
22,
13,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
i++ | i += 1 | def makeHeader(dg): return { 'album': dg('album', 'Unknown'), 'artist': dg('albumartist', dg('artist', 'Unknown')), 'file': dg('file'), 'cls': 'album-group-start', 'id': 'aa' + i } i++ | 14c19542baa6ffc8e67cde8626382cd56f6e6b84 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4699/14c19542baa6ffc8e67cde8626382cd56f6e6b84/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1864,
12,
72,
75,
4672,
327,
288,
296,
25090,
4278,
14938,
2668,
25090,
2187,
296,
4874,
19899,
296,
25737,
4278,
14938,
2668,
25090,
25737,
2187,
14938,
2668,
25737,
2187,
296,
4874,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
1864,
12,
72,
75,
4672,
327,
288,
296,
25090,
4278,
14938,
2668,
25090,
2187,
296,
4874,
19899,
296,
25737,
4278,
14938,
2668,
25090,
25737,
2187,
14938,
2668,
25737,
2187,
296,
4874,
... |
self.wired0 = urwid.RadioButton(self.wired_l,automatic_t) self.wired1 = DynRadioButton(self.wired_l,wired1_t) self.wired2 = DynRadioButton(self.wired_l,wired2_t) self.wired_l = [self.wired0,self.wired1,self.wired2] | self.wired0 = urwid.RadioButton(self.wired_l, automatic_t) self.wired1 = DynRadioButton(self.wired_l, wired1_t) self.wired2 = DynRadioButton(self.wired_l, wired2_t) self.wired_l = [self.wired0, self.wired1, self.wired2] | def __init__(self,body,pos,ui,dbus=None): global daemon, wireless, wired | b0005ec4de814166c61c5718311a6abcdfb25e8d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/353/b0005ec4de814166c61c5718311a6abcdfb25e8d/prefs_curses.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3432,
16,
917,
16,
4881,
16,
1966,
407,
33,
7036,
4672,
2552,
8131,
16,
6636,
2656,
16,
341,
2921,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3432,
16,
917,
16,
4881,
16,
1966,
407,
33,
7036,
4672,
2552,
8131,
16,
6636,
2656,
16,
341,
2921,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
raise DocImportError(filename, sys.exc_info()) | raise ErrorDuringImport(filename, sys.exc_info()) | def locate(path): """Locate an object by name (or dotted path), importing as necessary.""" if not path: # special case: imp.find_module('') strangely succeeds return None if type(path) is not types.StringType: return path parts = split(path, '.') n = len(parts) while n > 0: path = join(parts[:n], '.') try: module = freshimport(path) except: # Did the error occur before or after the module was found? (exc, value, tb) = info = sys.exc_info() if sys.modules.has_key(path): # An error occured while executing the imported module. raise ErrorDuringImport(sys.modules[path].__file__, info) elif exc is SyntaxError: # A SyntaxError occurred before we could execute the module. raise ErrorDuringImport(value.filename, info) elif exc is ImportError and \ split(lower(str(value)))[:2] == ['no', 'module']: # The module was not found. n = n - 1 continue else: # Some other error occurred before executing the module. raise DocImportError(filename, sys.exc_info()) try: x = module for p in parts[n:]: x = getattr(x, p) return x except AttributeError: n = n - 1 continue if hasattr(__builtins__, path): return getattr(__builtins__, path) return None | 4483cbd7eb6854684bc5af9c43d558ab8a2bcacf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/4483cbd7eb6854684bc5af9c43d558ab8a2bcacf/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10627,
12,
803,
4672,
3536,
1333,
340,
392,
733,
635,
508,
261,
280,
20965,
589,
3631,
25077,
487,
4573,
12123,
309,
486,
589,
30,
468,
4582,
648,
30,
1646,
18,
4720,
67,
2978,
2668,
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,
10627,
12,
803,
4672,
3536,
1333,
340,
392,
733,
635,
508,
261,
280,
20965,
589,
3631,
25077,
487,
4573,
12123,
309,
486,
589,
30,
468,
4582,
648,
30,
1646,
18,
4720,
67,
2978,
2668,
6... |
assert(len(self._mem_ports) == 2 or len(self._mem_ports) == 3) | assert(len(self._mem_ports) < 6) | def addPrivateSplitL1Caches(self, ic, dc): assert(len(self._mem_ports) == 2 or len(self._mem_ports) == 3) self.icache = ic self.dcache = dc self.icache_port = ic.cpu_side self.dcache_port = dc.cpu_side self._mem_ports = ['icache.mem_side', 'dcache.mem_side'] | ab598eadbfeefceb6501d4cca13147b660642d9e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6787/ab598eadbfeefceb6501d4cca13147b660642d9e/BaseCPU.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
6014,
5521,
48,
21,
18755,
12,
2890,
16,
13579,
16,
6744,
4672,
1815,
12,
1897,
12,
2890,
6315,
3917,
67,
4363,
13,
411,
1666,
13,
365,
18,
335,
807,
273,
13579,
365,
18,
72,
24... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
6014,
5521,
48,
21,
18755,
12,
2890,
16,
13579,
16,
6744,
4672,
1815,
12,
1897,
12,
2890,
6315,
3917,
67,
4363,
13,
411,
1666,
13,
365,
18,
335,
807,
273,
13579,
365,
18,
72,
24... |
path.setdefault(i, {}) | path.setdefault(i, { }) | def addPkg(self, pkg): """Add all files from RpmPackage pkg to self.""" | e0106769fd056a3d2a869a4070f727b30e66fa80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/e0106769fd056a3d2a869a4070f727b30e66fa80/lists.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
11264,
12,
2890,
16,
3475,
4672,
3536,
986,
777,
1390,
628,
534,
7755,
2261,
3475,
358,
365,
12123,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
11264,
12,
2890,
16,
3475,
4672,
3536,
986,
777,
1390,
628,
534,
7755,
2261,
3475,
358,
365,
12123,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return commandArgs; | return commandArgs; | def IdentityFn(commandArgs): return commandArgs; | e2dc7cca62da3c696a583c0590857d6af43a6e58 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12409/e2dc7cca62da3c696a583c0590857d6af43a6e58/script_utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7808,
5372,
12,
3076,
2615,
4672,
327,
1296,
2615,
31,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
7808,
5372,
12,
3076,
2615,
4672,
327,
1296,
2615,
31,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
raise ValueError("Quality score outside 0 to 93 found - these" " are probably in Solexa/Illumina FASTQ " "format, not the Sanger FASTQ format which " "uses PHRED scores.") | raise ValueError("PHRED quality score outside 0 to 93 found - " "your file is probably not in the standard " "Sanger FASTQ format. Check if it is one of the" "Solexa/Illumina variants instead.") | def FastqPhredIterator(handle, alphabet = single_letter_alphabet, title2ids = None) : """Generator function to iterate over FASTQ records (as SeqRecord objects). - handle - input file - alphabet - optional alphabet - title2ids - A function that, when given the title line from the FASTQ file (without the beginning >), will return the id, name and description (in that order) for the record as a tuple of strings. If this is not given, then the entire title line will be used as the description, and the first word as the id and name. Note that use of title2ids matches that of Bio.SeqIO.FastaIO. For each sequence in a (Sanger style) FASTQ file there is a matching string encoding the PHRED qualities (integers between 0 and about 90) using ASCII values with an offset of 33. For example, consider a file containing three short reads:: @EAS54_6_R1_2_1_413_324 CCCTTCTTGTCTTCAGCGTTTCTCC + ;;3;;;;;;;;;;;;7;;;;;;;88 @EAS54_6_R1_2_1_540_792 TTGGCAGGCCAAGGCCGATGGATCA + ;;;;;;;;;;;7;;;;;-;;;3;83 @EAS54_6_R1_2_1_443_348 GTTGCTTCTGGCGTGGGTGGGGGGG + ;;;;;;;;;;;9;7;;.7;393333 For each sequence (e.g. "CCCTTCTTGTCTTCAGCGTTTCTCC") there is a matching string encoding the PHRED qualities using a ASCI values with an offset of 33 (e.g. ";;3;;;;;;;;;;;;7;;;;;;;88"). Using this module directly you might run: >>> handle = open("Quality/example.fastq", "rU") >>> for record in FastqPhredIterator(handle) : ... print record.id, record.seq EAS54_6_R1_2_1_413_324 CCCTTCTTGTCTTCAGCGTTTCTCC EAS54_6_R1_2_1_540_792 TTGGCAGGCCAAGGCCGATGGATCA EAS54_6_R1_2_1_443_348 GTTGCTTCTGGCGTGGGTGGGGGGG >>> handle.close() Typically however, you would call this via Bio.SeqIO instead with "fastq" as the format: >>> from Bio import SeqIO >>> handle = open("Quality/example.fastq", "rU") >>> for record in SeqIO.parse(handle, "fastq") : ... print record.id, record.seq EAS54_6_R1_2_1_413_324 CCCTTCTTGTCTTCAGCGTTTCTCC EAS54_6_R1_2_1_540_792 TTGGCAGGCCAAGGCCGATGGATCA EAS54_6_R1_2_1_443_348 GTTGCTTCTGGCGTGGGTGGGGGGG >>> handle.close() If you want to look at the qualities, they are record in each record's per-letter-annotation dictionary as a simple list of integers: >>> print record.letter_annotations["phred_quality"] [26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 24, 26, 22, 26, 26, 13, 22, 26, 18, 24, 18, 18, 18, 18] """ assert SANGER_SCORE_OFFSET == ord("!") for title_line, seq_string, quality_string in FastqGeneralIterator(handle) : if title2ids : id, name, descr = title2ids(title_line) else : descr = title_line id = descr.split()[0] name = id record = SeqRecord(Seq(seq_string, alphabet), id=id, name=name, description=descr) qualities = [ord(letter)-SANGER_SCORE_OFFSET for letter in quality_string] if qualities and (min(qualities) < 0 or max(qualities) > 93) : raise ValueError("Quality score outside 0 to 93 found - these" " are probably in Solexa/Illumina FASTQ " "format, not the Sanger FASTQ format which " "uses PHRED scores.") record.letter_annotations["phred_quality"] = qualities yield record | 649aabe0d40c1eb98be1c26072c0087738451ed7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7167/649aabe0d40c1eb98be1c26072c0087738451ed7/QualityIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9545,
85,
3731,
1118,
3198,
12,
4110,
16,
10877,
273,
2202,
67,
13449,
67,
287,
8907,
16,
2077,
22,
2232,
273,
599,
13,
294,
3536,
3908,
445,
358,
7401,
1879,
24239,
53,
3853,
261,
345... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9545,
85,
3731,
1118,
3198,
12,
4110,
16,
10877,
273,
2202,
67,
13449,
67,
287,
8907,
16,
2077,
22,
2232,
273,
599,
13,
294,
3536,
3908,
445,
358,
7401,
1879,
24239,
53,
3853,
261,
345... |
else: | if pixbuf == None: | def update_preview(self, size=200): if not self.preview: return False pixbuf = None scn = gtk.gdk.screen_get_default() if not self.window.is_minimized() and scn.is_composited(): try: pixbuf = self.get_screenshot_xcomposite(scn, self.window, size) except: print "Error: couldn't get preview for %s"%self.name raise else: pixbuf = self.window.get_icon() self.preview_image.set_from_pixbuf(pixbuf) self.preview_image.set_size_request(size,size) del pixbuf gc.collect() | c77cb8edfb8dda905b94d674300710abe9dd31c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7075/c77cb8edfb8dda905b94d674300710abe9dd31c5/dockbarx.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
12102,
12,
2890,
16,
963,
33,
6976,
4672,
309,
486,
365,
18,
12102,
30,
327,
1083,
11871,
4385,
273,
599,
888,
82,
273,
22718,
18,
75,
2883,
18,
9252,
67,
588,
67,
1886,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
12102,
12,
2890,
16,
963,
33,
6976,
4672,
309,
486,
365,
18,
12102,
30,
327,
1083,
11871,
4385,
273,
599,
888,
82,
273,
22718,
18,
75,
2883,
18,
9252,
67,
588,
67,
1886,
14... |
def analyze_selection(parameters=None): | def analyze_selection(): | def analyze_selection(parameters=None): # A) calling ancestor if not ImmediateWithMemory.analyze_selection(parameters): return False # B) validating if not isinstance(context.application.cache.node, ConscanResults): return False # C) passed all tests: return True | aff886d942f1ac4c432833089fad64917f4445ff /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11052/aff886d942f1ac4c432833089fad64917f4445ff/scanner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
67,
10705,
13332,
468,
432,
13,
4440,
9731,
309,
486,
2221,
6785,
1190,
6031,
18,
304,
9508,
67,
10705,
12,
3977,
4672,
327,
1083,
468,
605,
13,
18075,
309,
486,
1549,
12,
2472,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12375,
67,
10705,
13332,
468,
432,
13,
4440,
9731,
309,
486,
2221,
6785,
1190,
6031,
18,
304,
9508,
67,
10705,
12,
3977,
4672,
327,
1083,
468,
605,
13,
18075,
309,
486,
1549,
12,
2472,
... |
inst = object.im_self note = (inst and ' method of %s instance' % classname(inst.__class__, mod) or ' unbound %s method' % classname(imclass, mod)) | if object.im_self: note = ' method of %s instance' % classname( object.im_self.__class__, mod) else: note = ' unbound %s method' % classname(imclass,mod) | def docroutine(self, object, name=None, mod=None, cl=None): """Produce text documentation for a function or method object.""" realname = object.__name__ name = name or realname note = '' skipdocs = 0 if inspect.ismethod(object): imclass = object.im_class if cl: if imclass is not cl: note = ' from ' + classname(imclass, mod) skipdocs = 1 else: inst = object.im_self note = (inst and ' method of %s instance' % classname(inst.__class__, mod) or ' unbound %s method' % classname(imclass, mod)) object = object.im_func | 829253c953a1561afa1fc68f3f1f063bd3197494 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/829253c953a1561afa1fc68f3f1f063bd3197494/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
22640,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
681,
33,
7036,
16,
927,
33,
7036,
4672,
3536,
25884,
977,
7323,
364,
279,
445,
578,
707,
733,
12123,
2863,
529,
273,
733,
16186,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
681,
33,
7036,
16,
927,
33,
7036,
4672,
3536,
25884,
977,
7323,
364,
279,
445,
578,
707,
733,
12123,
2863,
529,
273,
733,
16186,
... |
'license.txt' | 'license.txt', | def _find_rl_accel(): '''locate where the accelerator code lives''' _ = [] for x in [ './rl_addons/rl_accel', '../rl_addons/rl_accel', '../../rl_addons/rl_accel', './rl_accel', '../rl_accel', '../../rl_accel', './lib'] \ + glob.glob('./rl_accel-*/rl_accel')\ + glob.glob('../rl_accel-*/rl_accel') \ + glob.glob('../../rl_accel-*/rl_accel') \ : fn = pjoin(x,'_rl_accel.c') if isfile(pjoin(x,'_rl_accel.c')): _.append(x) if _: if len(_)>1: _.sort(_cmp_rl_accel_dirs) return abspath(_[0]) return None | f71a740316becb0390ba20f133bbc5e2ed089f23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/f71a740316becb0390ba20f133bbc5e2ed089f23/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
1321,
67,
30737,
13332,
9163,
25450,
1625,
326,
15153,
7385,
981,
328,
3606,
26418,
389,
273,
5378,
364,
619,
316,
306,
12871,
1321,
67,
1289,
7008,
19,
1321,
67,
30737,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
1321,
67,
30737,
13332,
9163,
25450,
1625,
326,
15153,
7385,
981,
328,
3606,
26418,
389,
273,
5378,
364,
619,
316,
306,
12871,
1321,
67,
1289,
7008,
19,
1321,
67,
30737,
2... |
this = apply(_quickfix.new_AllocClearingFeeIndicator, args) | this = _quickfix.new_AllocClearingFeeIndicator(*args) | def __init__(self, *args): this = apply(_quickfix.new_AllocClearingFeeIndicator, 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,
8763,
4756,
5968,
14667,
13140,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8763,
4756,
5968,
14667,
13140,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13... |
eventloop.addUrgent(lambda:singleclick.handleCommandLineArgs(filenames), "Open local file(s)") | eventloop.addUrgentCall(lambda:singleclick.handleCommandLineArgs(filenames), "Open local file(s)") | def application_openFiles_(self, nsapp, filenames): filenames = osFilenamesToFilenameTypes(filenames) eventloop.addUrgent(lambda:singleclick.handleCommandLineArgs(filenames), "Open local file(s)") nsapp.replyToOpenOrPrint_(NSApplicationDelegateReplySuccess) | 022041e7bd40ad794c4f5089d9a2e949cc382b23 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12354/022041e7bd40ad794c4f5089d9a2e949cc382b23/Application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2521,
67,
3190,
2697,
67,
12,
2890,
16,
3153,
2910,
16,
9066,
4672,
9066,
273,
1140,
25579,
6809,
774,
5359,
2016,
12,
19875,
13,
871,
6498,
18,
1289,
57,
26876,
319,
1477,
12,
14661,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2521,
67,
3190,
2697,
67,
12,
2890,
16,
3153,
2910,
16,
9066,
4672,
9066,
273,
1140,
25579,
6809,
774,
5359,
2016,
12,
19875,
13,
871,
6498,
18,
1289,
57,
26876,
319,
1477,
12,
14661,
... |
def comingup(items): | def comingup(items=None): | def comingup(items): import tv.record_client as ri import time result = '' cachefile = '%s/upsoon' % (config.FREEVO_CACHEDIR) if (os.path.exists(cachefile) and \ (abs(time.time() - os.path.getmtime(cachefile)) < 3600)): cache = open(cachefile,'r') for a in cache.readlines(): result = result + a cache.close() return result (status, recordings) = ri.getScheduledRecordings() progs = recordings.getProgramList() f = lambda a, b: cmp(a.start, b.start) progl = progs.values() progl.sort(f) today = [] tomorrow = [] later = [] for what in progl: if time.localtime(what.start)[2] == time.localtime()[2]: today.append(what) if time.localtime(what.start)[2] == (time.localtime()[2] + 1): tomorrow.append(what) if time.localtime(what.start)[2] > (time.localtime()[2] + 1): later.append(what) if len(today) > 0: result = result + 'Today:\n' for m in today: sub_title = '' if m.sub_title: sub_title = ' "' + m.sub_title + '" ' result = result + " " + str(m.title) + str(sub_title) + " at " + \ str(time.strftime('%I:%M%p',time.localtime(m.start))) + '\n' if len(tomorrow) > 0: result = result + 'Tomorrow:\n' for m in tomorrow: sub_title = '' if m.sub_title: sub_title = ' "' + m.sub_title + '" ' result = result + " " + str(m.title) + str(sub_title) + " at " + \ str(time.strftime('%I:%M%p',time.localtime(m.start))) + '\n' if len(later) > 0: for m in later: sub_title = '' if m.sub_title: sub_title = ' "' + m.sub_title + '" ' result = result + " " + str(m.title) + str(sub_title) + " at " + \ str(time.strftime('%I:%M%p',time.localtime(m.start))) + '\n' cache = open(cachefile,'w') cache.write(result) cache.close() return result | 1112418bbb35d80ba395b3822c58189393898b3f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/1112418bbb35d80ba395b3822c58189393898b3f/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19283,
416,
12,
3319,
33,
7036,
4672,
1930,
13521,
18,
3366,
67,
2625,
487,
12347,
1930,
813,
225,
563,
273,
875,
225,
1247,
768,
273,
1995,
87,
19,
416,
2048,
265,
11,
738,
261,
1425,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19283,
416,
12,
3319,
33,
7036,
4672,
1930,
13521,
18,
3366,
67,
2625,
487,
12347,
1930,
813,
225,
563,
273,
875,
225,
1247,
768,
273,
1995,
87,
19,
416,
2048,
265,
11,
738,
261,
1425,... |
def order(self, *gens, **kwds): | def order(self, *args, **kwds): | def order(self, *gens, **kwds): r""" Return the order with given ring generators in the maximal order of this number field. | 65d29c8a95ea9faea3800f96c664e08c7f675ca2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/65d29c8a95ea9faea3800f96c664e08c7f675ca2/number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1353,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
2000,
326,
1353,
598,
864,
9221,
13327,
316,
326,
943,
2840,
1353,
434,
333,
1300,
652,
18,
2,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1353,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
2000,
326,
1353,
598,
864,
9221,
13327,
316,
326,
943,
2840,
1353,
434,
333,
1300,
652,
18,
2,
-100,
-100,
-100,
-100,
... |
qu1[-1] = '(' + qu1[-1] + ' OR ' \ | qu1[-1] = '(' + qu1[-1] + ' AND ' \ | def _rec_get(ids, table, parent): if not ids: return [] ids2 = table.search(cursor, user, [(parent, 'in', ids), (parent, '!=', False)], context=context) return ids + _rec_get(ids2, table, parent) | aeb47b35becaaaf6a9664acce34bcf462def5d53 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9266/aeb47b35becaaaf6a9664acce34bcf462def5d53/orm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3927,
67,
588,
12,
2232,
16,
1014,
16,
982,
4672,
309,
486,
3258,
30,
327,
5378,
3258,
22,
273,
1014,
18,
3072,
12,
9216,
16,
729,
16,
306,
12,
2938,
16,
296,
267,
2187,
3258,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3927,
67,
588,
12,
2232,
16,
1014,
16,
982,
4672,
309,
486,
3258,
30,
327,
5378,
3258,
22,
273,
1014,
18,
3072,
12,
9216,
16,
729,
16,
306,
12,
2938,
16,
296,
267,
2187,
3258,
... |
for (int j = x_shp1_usable; j < %(x)->dimensions[3]; ++j) { | for (int j = x_shp1_usable; j < %(x)s->dimensions[3]; ++j) { | def c_code(self, node, name, (x, z, gz), (gx,), sub): fail = sub['fail'] self_ignore_border = int(self.ignore_border) ds0, ds1 = self.ds return """ int x_typenum = PyArray_ObjectType((PyObject*)%(x)s, 0); int z_typenum = PyArray_ObjectType((PyObject*)%(z)s, 0); int gz_typenum = PyArray_ObjectType((PyObject*)%(gz)s, 0); int x_shp0_usable; int x_shp1_usable; int z_shp0, z_shp1; if ((x_typenum != z_typenum) || (x_typenum != gz_typenum)) { PyErr_SetString(PyExc_ValueError, "input types must all match"); %(fail)s; } if(%(x)s->nd!=4) { PyErr_SetString(PyExc_ValueError, "x must be a 4d ndarray"); %(fail)s; } if(%(z)s->nd!=4) { PyErr_SetString(PyExc_ValueError, "z must be a 4d ndarray"); %(fail)s; } if(%(gz)s->nd!=4) { PyErr_SetString(PyExc_ValueError, "gz must be a 4d ndarray"); %(fail)s; } z_shp0 = %(z)s->dimensions[2]; z_shp1 = %(z)s->dimensions[3]; if (%(self_ignore_border)s) { x_shp0_usable = z_shp0 * %(ds0)s; x_shp1_usable = z_shp1 * %(ds1)s; } else { x_shp0_usable = %(x)s->dimensions[2]; x_shp1_usable = %(x)s->dimensions[3]; } if ((!%(gx)s) || *PyArray_DIMS(%(gx)s)!=4 ||(%(gx)s->dimensions[0] != %(x)s->dimensions[0]) ||(%(gx)s->dimensions[1] != %(x)s->dimensions[1]) ||(%(gx)s->dimensions[2] != %(x)s->dimensions[2]) ||(%(gx)s->dimensions[3] != %(x)s->dimensions[3]) ) { Py_XDECREF(%(gx)s); %(gx)s = (PyArrayObject*) PyArray_ZEROS(4, %(x)s->dimensions, x_typenum,0); } | 264d5091bb00c2fdd066c3ba93a22ac720fa0fb9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12438/264d5091bb00c2fdd066c3ba93a22ac720fa0fb9/downsample.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
710,
12,
2890,
16,
756,
16,
508,
16,
261,
92,
16,
998,
16,
14136,
3631,
261,
75,
92,
16,
3631,
720,
4672,
2321,
273,
720,
3292,
6870,
3546,
365,
67,
6185,
67,
8815,
273,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
276,
67,
710,
12,
2890,
16,
756,
16,
508,
16,
261,
92,
16,
998,
16,
14136,
3631,
261,
75,
92,
16,
3631,
720,
4672,
2321,
273,
720,
3292,
6870,
3546,
365,
67,
6185,
67,
8815,
273,
5... |
{'gal':'Abbreviation for galileo.\nDefined to be 1/100 meter/second^2.', 'galileo':'Defined to be 1/100 meter/second^2.', 'gravity':'Also called standard gravity.\nPhysical constant defined to be 9.80665 meter/second^2.'}, | {'gal':'Abbreviation for galileo.\nDefined to be 1/100 meter/second^2.', 'galileo':'Defined to be 1/100 meter/second^2.', 'gravity':'Also called standard gravity.\nPhysical constant defined to be 9.80665 meter/second^2.'}, | def evalunitdict(): """ Replace all the string values of the unitdict variable by their evaluated forms, and builds some other tables for ease of use. This function is mainly used internally, for efficiency (and flexibility) purposes, making it easier to describe the units. EXAMPLES:: sage: sage.symbolic.units.evalunitdict() """ from sage.misc.all import sage_eval for key, value in unitdict.iteritems(): unitdict[key] = dict([(a,sage_eval(repr(b))) for a, b in value.iteritems()]) # FEATURE IDEA: create a function that would allow users to add # new entries to the table without having to know anything about # how the table is stored internally. # # Format the table for easier use. # for k, v in unitdict.iteritems(): for a in v: unit_to_type[a] = k for w in unitdict.iterkeys(): for j in unitdict[w].iterkeys(): if type(unitdict[w][j]) == tuple: unitdict[w][j] = unitdict[w][j][0] value_to_unit[w] = dict(zip(unitdict[w].itervalues(), unitdict[w].iterkeys())) | 36d2f28c044694ad73a4a70a9d869366d0e39ec4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/36d2f28c044694ad73a4a70a9d869366d0e39ec4/units.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
353,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5302,
4873,
1576,
13332,
3536,
6910,
777,
326,
533,
924,
434,
326,
2836,
1576,
2190,
635,
3675,
12697,
10138,
16,
471,
10736,
2690,
1308,
4606,
364,
28769,
434,
999,
18,
1220,
445,
353,
... |
def _insertRecord(self, dbTable, ps): | def _insertRecord(self, dbTable, ps): | dcff16115fd4b90da4b2aad9583613f6ddb7920b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6552/dcff16115fd4b90da4b2aad9583613f6ddb7920b/DatabaseLogger.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6387,
2115,
12,
2890,
16,
1319,
1388,
16,
4250,
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,
389,
6387,
2115,
12,
2890,
16,
1319,
1388,
16,
4250,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
fatal("On Windows, HDF5 directory must be specified.") | warn("On Windows, HDF5 directory must be specified.") hdf5_loc = '.' | def __init__(self, hdf5_loc=None): if sys.platform == 'win32': if hdf5_loc is None: fatal("On Windows, HDF5 directory must be specified.") | 23178bac2b70aea840da6c42d1971a3d54a1f2d5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10380/23178bac2b70aea840da6c42d1971a3d54a1f2d5/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
24217,
25,
67,
1829,
33,
7036,
4672,
309,
2589,
18,
9898,
422,
296,
8082,
1578,
4278,
309,
24217,
25,
67,
1829,
353,
599,
30,
10081,
2932,
1398,
8202,
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,
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,
24217,
25,
67,
1829,
33,
7036,
4672,
309,
2589,
18,
9898,
422,
296,
8082,
1578,
4278,
309,
24217,
25,
67,
1829,
353,
599,
30,
10081,
2932,
1398,
8202,
16... |
if n[1] == "noaa": | if n[1] == "temp": | def testSomeAttrs(self): # Same export as testAnaNetwork, but check that the # attributes are synchronised query = dballe.Record() query.set("var", "B10004") query.setdate(datetime(2007, 1, 1, 0, 0, 0)) vars = read(self.db.query(query), (AnaIndex(), NetworkIndex()), attributes=('B33040',)) self.assertEquals(len(vars), 1) self.assertEquals(vars.keys(), ["B10004"]) data = vars["B10004"] self.assertEquals(len(data.attrs), 1) self.assertEquals(data.attrs.keys(), ['B33040']) | 60683e224bc1574032e74911fbb9f3160ff91a4b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2863/60683e224bc1574032e74911fbb9f3160ff91a4b/test-volnd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
17358,
8262,
12,
2890,
4672,
468,
17795,
3359,
487,
1842,
979,
69,
3906,
16,
1496,
866,
716,
326,
468,
1677,
854,
3248,
5918,
843,
273,
1319,
22534,
18,
2115,
1435,
843,
18,
542,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
17358,
8262,
12,
2890,
4672,
468,
17795,
3359,
487,
1842,
979,
69,
3906,
16,
1496,
866,
716,
326,
468,
1677,
854,
3248,
5918,
843,
273,
1319,
22534,
18,
2115,
1435,
843,
18,
542,
... |
for key, val in match.groupdict().iteritems(): if val is not None: setattr(parser.values, key, val) | parser.values.proxy_ip = match.group('proxy_ip') parser.values.proxy_port = int(match.group('proxy_port') or '5060') | def parse_proxy(value, parser): match = re_ip_port.match(value) if match is None: raise OptionValueError("Could not parse supplied outbound proxy address") for key, val in match.groupdict().iteritems(): if val is not None: setattr(parser.values, key, val) | 8e1215f57b84fa0f4c6dd8990db72cc4c9fbd6c6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3446/8e1215f57b84fa0f4c6dd8990db72cc4c9fbd6c6/test_subscribediff.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
5656,
12,
1132,
16,
2082,
4672,
845,
273,
283,
67,
625,
67,
655,
18,
1916,
12,
1132,
13,
309,
845,
353,
599,
30,
1002,
2698,
23610,
2932,
4445,
486,
1109,
4580,
11663,
2889,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5656,
12,
1132,
16,
2082,
4672,
845,
273,
283,
67,
625,
67,
655,
18,
1916,
12,
1132,
13,
309,
845,
353,
599,
30,
1002,
2698,
23610,
2932,
4445,
486,
1109,
4580,
11663,
2889,
... |
try: self.setInput(idx, None) if self.setInput(idx, self._cachedInputs[idx]): | if self._cachedInputs[idx] == None: try: self.setInput(idx, None) except Exception, e: genUtils.logError( 'Error disconnecting input %d of slice3dVWR ' \ '%s:%s. ' % \ (idx, self._moduleManager.getInstanceName(self), str(e))) elif self._cachedInputs[idx] != -1: try: self.setInput(idx, None) except Exception, e: genUtils.logError( 'Error disconnecting input %d of slice3dVWR ' \ '%s before reconnect:%s. Going to attempt ' \ 'reconnection anyway.' % \ (idx, self._moduleManager.getInstanceName(self), str(e))) try: | def enableExecution(self): self._executionEnabled = True if self._dummyRenderer: # put old renderer back and destroy dummyRenderer rw = self.threedFrame.threedRWI.GetRenderWindow() rw.RemoveRenderer(self._dummyRenderer) rw.AddRenderer(self._threedRenderer) self._dummyRenderer.RemoveAllProps() self._dummyRenderer = None | ec626658847ba34cb79215d4e5c8b82111eb4162 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/ec626658847ba34cb79215d4e5c8b82111eb4162/slice3dVWR.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4237,
3210,
12,
2890,
4672,
365,
6315,
16414,
1526,
273,
1053,
309,
365,
6315,
21050,
6747,
30,
225,
468,
1378,
1592,
5690,
1473,
471,
5546,
9609,
6747,
7985,
273,
365,
18,
451,
15656,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4237,
3210,
12,
2890,
4672,
365,
6315,
16414,
1526,
273,
1053,
309,
365,
6315,
21050,
6747,
30,
225,
468,
1378,
1592,
5690,
1473,
471,
5546,
9609,
6747,
7985,
273,
365,
18,
451,
15656,
3... |
f = open('/dev/null', 'wb') | if sys.platform[:3]=="win": f = open('nul', 'wb') else: f = open('/dev/null', 'wb') | def main(): VERBOSE = 0 opts, args = getopt.getopt(sys.argv[1:], 'vq') for k, v in opts: if k == '-v': VERBOSE = 1 visitor.ASTVisitor.VERBOSE = visitor.ASTVisitor.VERBOSE + 1 if k == '-q': f = open('/dev/null', 'wb') sys.stdout = f if not args: print "no files to compile" else: for filename in args: if VERBOSE: print filename compile(filename) | 866b5b1ea7b54d941ac50717de099b2026a9f518 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/866b5b1ea7b54d941ac50717de099b2026a9f518/compile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
27857,
273,
374,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
90,
85,
6134,
364,
417,
16,
331,
316,
1500,
30,
309,
417,
422,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
27857,
273,
374,
1500,
16,
833,
273,
336,
3838,
18,
588,
3838,
12,
9499,
18,
19485,
63,
21,
30,
6487,
296,
90,
85,
6134,
364,
417,
16,
331,
316,
1500,
30,
309,
417,
422,... |
result = runBuildTestCase(inOptions, buildTestCase, timings.deepCopy()) | result = runBuildTestCase(inOptions, buildTestCase, timings) | def runBuildTestCaseDriver(inOptions, baseTestDir, buildTestCase, timings): success = True buildTestCaseName = buildTestCase.name print "\n***" print "*** Doing build and test of "+buildTestCaseName+" ..." print "***\n" if buildTestCase.runBuildTestCase: try: echoChDir(baseTestDir) writeDefaultBuildSpecificConfigFile(buildTestCaseName) result = runBuildTestCase(inOptions, buildTestCase, timings.deepCopy()) if not result: success = False except Exception, e: success = False printStackTrace() else: print "\nSkipping "+buildTestCaseName+" build/test on request!\n" return success | 26538f87d17f40e36336886e498e42a3f3eadc4d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1130/26538f87d17f40e36336886e498e42a3f3eadc4d/CheckinTest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
3116,
4709,
2449,
4668,
12,
267,
1320,
16,
1026,
4709,
1621,
16,
1361,
4709,
2449,
16,
1658,
899,
4672,
225,
2216,
273,
1053,
225,
1361,
4709,
2449,
461,
273,
1361,
4709,
2449,
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,
1086,
3116,
4709,
2449,
4668,
12,
267,
1320,
16,
1026,
4709,
1621,
16,
1361,
4709,
2449,
16,
1658,
899,
4672,
225,
2216,
273,
1053,
225,
1361,
4709,
2449,
461,
273,
1361,
4709,
2449,
18,... |
def set_output(self, key, val) : """ | def set_output(self, key, val): """ | def set_input(self, key, val=None, notify=True): """ Define the input value for the specified index/key """ | 0ceea93f880b610f6ec05e7f6f0d32b2a4dd7e66 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11338/0ceea93f880b610f6ec05e7f6f0d32b2a4dd7e66/node.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2630,
12,
2890,
16,
498,
16,
1244,
33,
7036,
16,
5066,
33,
5510,
4672,
3536,
13184,
326,
810,
460,
364,
326,
1269,
770,
19,
856,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
2630,
12,
2890,
16,
498,
16,
1244,
33,
7036,
16,
5066,
33,
5510,
4672,
3536,
13184,
326,
810,
460,
364,
326,
1269,
770,
19,
856,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def demosaic(pixels): """ We assume for now that the bayer pattern is B G B G G R G R Image sizes are even. This means that the padded input image pattern is 0 B G B G 0 0 G R G R 0 """ if(False): return(pixels) h = pixels.shape[0] w = pixels.shape[1] out = pixels.copy() for i in range(1, h, 2): out[i, 0, 0] = .5 * pixels[i, 1, 0] out[i, 2:w:2, 0] = .5 * (pixels[i, 1:w-2:2, 0] + pixels[i, 3:w:2, 0]) out[0, 0, 0] = .25 * pixels[1, 1, 0] out[0, 2:w:2, 0] = .25 * (pixels[1, 1:w-2:2, 0] + pixels[1, 3:w:2, 0]) for i in range(2, h, 2): out[i, 0, 0] = .25 * (pixels[i-1, 1, 0] + pixels[i+1, 1, 0]) out[i, 2:w:2, 0] = .25 * (pixels[i-1, 1:w-2:2, 0] + pixels[i-1, 3:w:2, 0] + pixels[i+1, 1:w-2:2, 0] + pixels[i+1, 3:w:2, 0]) for i in range(0, h, 2): out[i, -1, 2] = .5 * pixels[i, -2, 2] out[i, 1:w-2:2, 2] = .5 * (pixels[i, 0:w-3:2, 2] + pixels[i, 2:w:2, 2]) out[-1, -1, 2] = .25 * pixels[-2, -2, 2] out[-1, 1:w-2:2, 2] = .25 * (pixels[-2, 0:w-3:2, 2] + pixels[-2, 2:w:2, 2]) for i in range(1, h-2, 2): out[i, -1, 2] = .25 * (pixels[i-1, -2, 2] + pixels[i+1, -2, 2]) out[i, 1:w-2:2, 2] = .25 * (pixels[i-1, 0:w-3:2, 2] + pixels[i-1, 2:w:2, 2] + pixels[i+1, 0:w-3:2, 2] + pixels[i+1, 2:w:2, 2]) out[-1, -1, 1] = .25 * (pixels[-2, -1, 1] + pixels[-1, -2, 1]) out[-1, 1:w-2:2, 1] = .25 * (pixels[-1, 0:w-3:2, 1] + pixels[-1, 2:w:2, 1] + pixels[-2, 1:w-2:2, 1]) for i in range(1, h-2, 2): out[i, -1, 1] = .25 * (pixels[i-1, -1, 1] + pixels[i, -2, 1] + pixels[i+1, -1, 1]) out[i, 1:w-2:2, 1] = .25 * (pixels[i-1, 1:w-2:2, 1] + pixels[i, 0:w-3:2, 1] + pixels[i, 2:w:2, 1] + pixels[i+1, 1:w-2:2, 1]) out[0, 0, 1] = .25 * (pixels[0, 1, 1] + pixels[1, 0, 1]) out[0, 2:w:2, 1] = .25 * (pixels[0, 1:w-2:2, 1] + pixels[0, 3:w:2, 1] + pixels[1, 2:w:2, 1]) for i in range(2, h, 2): out[i, 0, 1] = .25 * (pixels[i-1, 0, 1] + pixels[i, 1, 1] + pixels[i+1, 0, 1]) out[i, 2:w:2, 1] = .25 * (pixels[i-1, 2:w:2, 1] + pixels[i, 1:w-2:2, 1] + pixels[i, 3:w:2, 1] + pixels[i+1, 2:w:2, 1]) return(out) | def decode_pixel_data(data, raw_info, makernote_ifd, makernote_abs_offset, verbose=False): """ The linearization table is stored inside the Nikon Marker Note and is >1000 bytes in length. The format is as follows: (start=initial_offset+base_offset) 1 byte version0 1 byte version1 (if version0==0x49 and version1==0x58: data.seek(2110, os.SEEK_CUR)) 4 short vert_preds[2 x 2] 1 short curve length (n) n short curve values (if version0==0x44 and version1==0x20: data.seek(start+562, os.SEEK_SET) 1 short split value) """ # Get the NEF compression flag. compression = makernote_ifd[NEF_COMPRESSION_TAG_ID][-1] # Get the image bits per sample (either 12 or 14 ususally). image_bps = raw_info['img_bps'] # Get the abs offset to the linearization curve. [abs_offset, tag, typ_fmt, l, val] = makernote_ifd[NIKON_LINCURVE_TAG_ID] # Remember that val is already a list of l elements of type typ_fmt. data.seek(abs_offset, os.SEEK_SET) # See is we have to do any reading from data. if(typ_fmt == 'B'): v0, v1 = val[:2] data.seek(2, os.SEEK_CUR) # keep track of where we are in data. else: v0, v1 = unpack('BB', data.read(2)) # Choose the appropriate NIKON Huffman tree index. tree_index = 0 if(v0 == 0x46): tree_index = 2 if(image_bps == 14): tree_index += 3 # For some combination of v0 and v1 we need to seek ahead a fixed ammount. if(v0 == 0x49 or v1 == 0x58): # FIXME: is it correct? Do we need to add 2 (see dcraw.c:1137)? data.seek(abs_offset + 2 + 2110, os.SEEK_SET) # Read the vertical predictor 2x2 matrix. # TODO: simple optimization: use the bytes in val rather than reading data. horiz_preds = [0, 0] vert_preds = [[0, 0], [0, 0]] (vert_preds[0][0], vert_preds[0][1], vert_preds[1][0], vert_preds[1][1]) = unpack('HHHH', data.read(8)) max = 1 << image_bps & 0x7fff num_points = unpack('H', data.read(2))[0] if(num_points > 1): step = int(float(max) / (num_points - 1)) values = unpack('H'*num_points, data.read(num_points * 2)) # Decode the curve. curve = None split_row = -1 if(v0 == 0x44 and v1 == 0x20 and step > 0): curve_max_len = 1 << tiff_bps & 0x7fff # The curve has length `curve_max_len` but we only have a `num_points` # points, so we need to interpolate. step = int(float(curve_max_len) / float(curve_size - 1)) curve = [0, ] * curve_max_len for i in xrange(num_points): curve[i*step] = values[i] # Now interpolate between those values. step = float(step) for i in xrange(curve_max_len): curve[i] = int(float(curve[i-i%step] * (step-i%step) + curve[i-i%step+step] * (i%step)) / step) # Finally, get the 'split value'. This is the row where we need to # re-init the Huffman tree. data.seek(abs_offset + 562, os.SEEK_SET) split_row = unpack('H', data.read(2)) elif(v0 != 0x46 and num_points <= 16385): # Simple case: curve = values. Also, no split row here. curve = values curve_max_len = num_points else: raise(Exception('Unsupported Nikon linearization curve.')) # Sometimes curve elements are repeated at the end. Get the number of # distinct elements. while(curve[curve_max_len-2] == curve[curve_max_len-1]): curve_max_len -= 1 # Now decode the pixel values. This is a bit of a mess, but not too bad. pixel_abs_offset = raw_info['img_offset'] data.seek(pixel_abs_offset, os.SEEK_SET) # Get the image size. width = raw_info['img_width'] height = raw_info['img_height'] # Cast data into a string of bits of length width * height * 8 byte_buffer = numpy.fromfile(data, dtype=numpy.uint8) bit_buffer = numpy.ascontiguousarray(numpy.unpackbits(byte_buffer), dtype=numpy.uint8) # Decode the actual pixel differences/deltas. deltas = pixelutils.decode_pixel_deltas(width, height, tree_index, bit_buffer, split_row, NIKON_TREE) # Now turn all those deltas in pixel values. The only raw pixel value is # the one at top, left for each color. Differences are done color by color. # pixels = compute_pixel_values(deltas, horiz_preds, vert_preds, curve) pixels = pixelutils.compute_pixel_values(deltas, horiz_preds, vert_preds, curve) # Now demosaic the Bayer pattern. demosaiced = demosaic(pixels) if(verbose): import Image img = Image.fromarray(demosaiced, 'RGB') img.show() # These are rescaled pixel values. To get the real pixel values we need to # multiply their value by the linearization curve. return(curve) | 80052fbda414816bdd6d5dfa141af54964b22742 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6485/80052fbda414816bdd6d5dfa141af54964b22742/nef_decoder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
67,
11743,
67,
892,
12,
892,
16,
1831,
67,
1376,
16,
312,
6388,
7652,
67,
430,
72,
16,
312,
6388,
7652,
67,
5113,
67,
3348,
16,
3988,
33,
8381,
4672,
3536,
1021,
9103,
1588,
10... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2495,
67,
11743,
67,
892,
12,
892,
16,
1831,
67,
1376,
16,
312,
6388,
7652,
67,
430,
72,
16,
312,
6388,
7652,
67,
5113,
67,
3348,
16,
3988,
33,
8381,
4672,
3536,
1021,
9103,
1588,
10... | |
assert redirect == u"/blog/%s" % self.notebook.object_id | assert redirect == u"/blog/%s" % self.notebook.name | def test_default_blog( self ): self.login() | a88d5cbd2330d0cb271a06ac18c0425926cb4d02 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6754/a88d5cbd2330d0cb271a06ac18c0425926cb4d02/Test_notebooks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1886,
67,
11439,
12,
365,
262,
30,
365,
18,
5819,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
67,
1886,
67,
11439,
12,
365,
262,
30,
365,
18,
5819,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
if pathname and pathname[0] == '/': | if not pathname: return pathname if pathname[0] == '/': | def convert_path (pathname): """Return 'pathname' as a name that will work on the native filesystem, i.e. split it on '/' and put it back together again using the current directory separator. Needed because filenames in the setup script are always supplied in Unix style, and have to be converted to the local convention before we can actually use them in the filesystem. Raises ValueError on non-Unix-ish systems if 'pathname' either starts or ends with a slash. """ if os.sep == '/': return pathname if pathname and pathname[0] == '/': raise ValueError, "path '%s' cannot be absolute" % pathname if pathname and pathname[-1] == '/': raise ValueError, "path '%s' cannot end with '/'" % pathname paths = string.split(pathname, '/') while '.' in paths: paths.remove('.') if not paths: return os.curdir return apply(os.path.join, paths) | 0123ec5f56f1bea434ab9b7b547337b250c0f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0123ec5f56f1bea434ab9b7b547337b250c0f3b3/util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
803,
261,
28336,
4672,
3536,
990,
296,
28336,
11,
487,
279,
508,
716,
903,
1440,
603,
326,
6448,
6496,
16,
277,
18,
73,
18,
1416,
518,
603,
2023,
471,
1378,
518,
1473,
9475,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
803,
261,
28336,
4672,
3536,
990,
296,
28336,
11,
487,
279,
508,
716,
903,
1440,
603,
326,
6448,
6496,
16,
277,
18,
73,
18,
1416,
518,
603,
2023,
471,
1378,
518,
1473,
9475,
... |
tools=(%s,) | tools=%s | def generateHeader(self, outfile): s1 = self.TEMPLATE_HEADER % time.ctime() outfile.write(s1) | e203d68cd9c62bc62177b3acf1855374317940ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11941/e203d68cd9c62bc62177b3acf1855374317940ae/ArchGenXML.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
1864,
12,
2890,
16,
8756,
4672,
272,
21,
273,
365,
18,
12205,
67,
7557,
738,
813,
18,
21261,
1435,
8756,
18,
2626,
12,
87,
21,
13,
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,
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,
2103,
1864,
12,
2890,
16,
8756,
4672,
272,
21,
273,
365,
18,
12205,
67,
7557,
738,
813,
18,
21261,
1435,
8756,
18,
2626,
12,
87,
21,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if resp[:3] != '111': | if not resp.startswith(b'111'): | def date (self): """Process the DATE command. Arguments: None Returns: resp: server response if successful date: Date suitable for newnews/newgroups commands etc. time: Time suitable for newnews/newgroups commands etc.""" | 17de0ac39e028b8777529030dfc984cdf592a543 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/17de0ac39e028b8777529030dfc984cdf592a543/nntplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1509,
261,
2890,
4672,
3536,
2227,
326,
11457,
1296,
18,
13599,
30,
599,
2860,
30,
1718,
30,
1438,
766,
309,
6873,
1509,
30,
2167,
10631,
364,
394,
18443,
19,
2704,
4650,
4364,
5527,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1509,
261,
2890,
4672,
3536,
2227,
326,
11457,
1296,
18,
13599,
30,
599,
2860,
30,
1718,
30,
1438,
766,
309,
6873,
1509,
30,
2167,
10631,
364,
394,
18443,
19,
2704,
4650,
4364,
5527,
18,... |
self.bubbleRect.hide() | def mouseReleaseEvent(self, e): self.holdoff=False if not self.rootCluster: return if self.parent.SelectionMode and self.cutOffLineDragged: self.cutOffLineDragged=False self.bubbleRect.hide() self.setCutOffLine(e.scenePos().x()) | 8831277dc381559aa4de7aa848bba2c91b0d2e4c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6366/8831277dc381559aa4de7aa848bba2c91b0d2e4c/OWHierarchicalClustering.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
7391,
1133,
12,
2890,
16,
425,
4672,
365,
18,
21056,
3674,
33,
8381,
309,
486,
365,
18,
3085,
3629,
30,
327,
309,
365,
18,
2938,
18,
6233,
2309,
471,
365,
18,
5150,
7210,
1670,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7644,
7391,
1133,
12,
2890,
16,
425,
4672,
365,
18,
21056,
3674,
33,
8381,
309,
486,
365,
18,
3085,
3629,
30,
327,
309,
365,
18,
2938,
18,
6233,
2309,
471,
365,
18,
5150,
7210,
1670,
... | |
def __init__(self, data, color_key = None, header = False, link = None): if link: | def __init__(self, data, color_key = None, header = False, link = None, tooltip = None ): if link and tooltip: self.data = '<a href="%s" title="%s">%s</a>' \ % (link, tooltip, data) elif tooltip: self.data = '<a href="%s" title="%s">%s</a>' \ % (' elif link: | def __init__(self, data, color_key = None, header = False, link = None): if link: self.data = '<a href="%s">%s</a>' % (link, data) else: self.data = data if color_map.has_key(color_key): self.color = color_map[color_key] elif header: self.color = color_map['header'] elif data: self.color = color_map['plain_text'] else: self.color = color_map['blank'] self.header = header | 5958a8a4b9fbbddc47d7050825e700de71888f9f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/5958a8a4b9fbbddc47d7050825e700de71888f9f/display.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
2036,
67,
856,
273,
599,
16,
1446,
273,
1083,
16,
1692,
273,
599,
16,
11915,
273,
599,
262,
30,
309,
1692,
471,
11915,
30,
365,
18,
892,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
501,
16,
2036,
67,
856,
273,
599,
16,
1446,
273,
1083,
16,
1692,
273,
599,
16,
11915,
273,
599,
262,
30,
309,
1692,
471,
11915,
30,
365,
18,
892,
273,
... |
apply(StorageBase.__init__,(self,self.name,self.path)) | apply( StorageBase.__init__, ( self, self.name, self.path ) ) | def __init__(self,storageName,protocol,path,host,port,spaceToken,wspath): self.isok = True self.gfal = False self.lcg_util = False | 70e66af095cb6701e39b1e701e4a2ce4d012b4f7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/70e66af095cb6701e39b1e701e4a2ce4d012b4f7/SRM2Storage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
5697,
461,
16,
8373,
16,
803,
16,
2564,
16,
655,
16,
2981,
1345,
16,
4749,
803,
4672,
365,
18,
291,
601,
273,
1053,
365,
18,
75,
74,
287,
273,
1083,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1001,
2738,
972,
12,
2890,
16,
5697,
461,
16,
8373,
16,
803,
16,
2564,
16,
655,
16,
2981,
1345,
16,
4749,
803,
4672,
365,
18,
291,
601,
273,
1053,
365,
18,
75,
74,
287,
273,
1083,
... |
code = 'code %s' % airport[3] elif airport[5]: | def airport_search(self, event, query): ids = self._airport_search(query) if len(ids) == 0: event.addresponse(u"Sorry, I don't know that airport") elif len(ids) == 1: id = ids[0] airport = self.airports[id] code = 'unknown code' if airport[4] and airport[5]: code = 'codes %s and %s' % (airport[3], airport[4]) elif airport[4]: code = 'code %s' % airport[3] elif airport[5]: code = 'code %s' % airport[4] event.addresponse(u'%s in %s, %s has %s' % (airport[0], airport[1], airport[2], code)) else: results = [] for id in ids: airport = self.airports[id] code = '' if airport[3] or airport[4]: code = ' (%s)' % u'/'.join(filter(lambda c: c, airport[3:5])) results.append('%s%s' % (airport[0], code)) event.addresponse(u'Found the following airports: %s', human_join(results)[:480]) | 3da49931753947bde220021e3f4ff3f65c514131 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12048/3da49931753947bde220021e3f4ff3f65c514131/flight.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23350,
655,
67,
3072,
12,
2890,
16,
871,
16,
843,
4672,
3258,
273,
365,
6315,
1826,
655,
67,
3072,
12,
2271,
13,
309,
562,
12,
2232,
13,
422,
374,
30,
871,
18,
1289,
2740,
12,
89,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23350,
655,
67,
3072,
12,
2890,
16,
871,
16,
843,
4672,
3258,
273,
365,
6315,
1826,
655,
67,
3072,
12,
2271,
13,
309,
562,
12,
2232,
13,
422,
374,
30,
871,
18,
1289,
2740,
12,
89,
... | |
'date_start': time.strftime('%Y-01-01'), 'date_stop': time.strftime('%Y-12-31'), 'period': lambda *a: 'month', 'sale_tax': lambda *a: 0.0, 'purchase_tax': lambda *a: 0.0, | 'date_start': lambda *a: time.strftime('%Y-01-01'), 'date_stop': lambda *a: time.strftime('%Y-12-31'), 'period': 'month', 'sale_tax': 0.0, 'purchase_tax': 0.0, | def _get_default_charts(self, cr, uid, context=None): module_name = False company_id = self._default_company(cr, uid, context=context) company = self.pool.get('res.company').browse(cr, uid, company_id) address_id = self.pool.get('res.partner').address_get(cr, uid, [company.partner_id.id]) if address_id['default']: address = self.pool.get('res.partner.address').browse(cr, uid, address_id['default']) code = address.country_id.code module_name = (code and 'l10n_' + code.lower()) or False if module_name: module_id = self.pool.get('ir.module.module').search(cr, uid, [('name', '=', module_name)]) if module_id: return module_name return 'configurable' | 4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/4e9fac63375f0cf2eb3df570fcbde6d1ecddff2d/installer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
1886,
67,
11563,
87,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
1605,
67,
529,
273,
1083,
9395,
67,
350,
273,
365,
6315,
1886,
67,
16840,
12,
3353,
16,
4555... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
1886,
67,
11563,
87,
12,
2890,
16,
4422,
16,
4555,
16,
819,
33,
7036,
4672,
1605,
67,
529,
273,
1083,
9395,
67,
350,
273,
365,
6315,
1886,
67,
16840,
12,
3353,
16,
4555... |
else: return -1 | name_cmp = cmp(self.canonical_name, other.canonical_name) if name_cmp == 0: return -1 else: return name_cmp | def __cmp__(self, other): if not isinstance(other, APIDoc): return -1 if self.__dict__ is other.__dict__: return 0 else: return -1 | 6658f223e3e512fd6232c0f14da73c6e49bf2067 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/6658f223e3e512fd6232c0f14da73c6e49bf2067/apidoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
309,
486,
1549,
12,
3011,
16,
14410,
734,
504,
4672,
327,
300,
21,
309,
365,
16186,
1576,
972,
353,
1308,
16186,
1576,
972,
30,
327,
374,
469... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
9625,
972,
12,
2890,
16,
1308,
4672,
309,
486,
1549,
12,
3011,
16,
14410,
734,
504,
4672,
327,
300,
21,
309,
365,
16186,
1576,
972,
353,
1308,
16186,
1576,
972,
30,
327,
374,
469... |
if str(e).find('database "%s" does not exist' % TESTDB) > 0: pass else: | if str(e).find('database "%s" does not exist' % TESTDB) == -1 : | def create_database(): """Create an empty BioSQL database.""" # first open a connection to create the database server = BioSeqDatabase.open_database(driver = DBDRIVER, user = DBUSER, passwd = DBPASSWD, host = DBHOST) # Auto-commit: postgresql cannot drop database in a transaction try: server.adaptor.autocommit() except AttributeError: pass # drop anything in the database try: # with Postgres, can get errors about database still being used and # not able to be dropped. Wait briefly to be sure previous tests are # done with it. import time time.sleep(1) sql = r"DROP DATABASE " + TESTDB server.adaptor.cursor.execute(sql, ()) except server.module.OperationalError: # the database doesn't exist pass except (server.module.IntegrityError, server.module.ProgrammingError), e: # ditto--perhaps if str(e).find('database "%s" does not exist' % TESTDB) > 0: pass else: raise # create a new database sql = r"CREATE DATABASE " + TESTDB server.adaptor.execute(sql, ()) server.adaptor.conn.close() # now open a connection to load the database server = BioSeqDatabase.open_database(driver = DBDRIVER, user = DBUSER, passwd = DBPASSWD, host = DBHOST, db = TESTDB) server.load_database_sql(SQL_FILE) server.adaptor.conn.commit() server.adaptor.conn.close() | 1ad2ebc30fa85a40017709746c49c87d2564fbca /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7167/1ad2ebc30fa85a40017709746c49c87d2564fbca/test_BioSQL.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
6231,
13332,
3536,
1684,
392,
1008,
21209,
3997,
2063,
12123,
468,
1122,
1696,
279,
1459,
358,
752,
326,
2063,
1438,
273,
21209,
6926,
4254,
18,
3190,
67,
6231,
12,
7407,
273,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
6231,
13332,
3536,
1684,
392,
1008,
21209,
3997,
2063,
12123,
468,
1122,
1696,
279,
1459,
358,
752,
326,
2063,
1438,
273,
21209,
6926,
4254,
18,
3190,
67,
6231,
12,
7407,
273,
2... |
Chatter.write('Wrote %d old reflections to REMOVE.HKL' % \ len(current_remove)) | Debug.write('Wrote %d old reflections to REMOVE.HKL' % \ len(current_remove)) | def _integrate_finish(self): '''Finish off the integration by running correct.''' | e46559eba837758a5c321db37c199922a1987e9a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3290/e46559eba837758a5c321db37c199922a1987e9a/XDSIntegrater.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14970,
5141,
67,
13749,
12,
2890,
4672,
9163,
11641,
3397,
326,
12040,
635,
3549,
3434,
1093,
6309,
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,
389,
14970,
5141,
67,
13749,
12,
2890,
4672,
9163,
11641,
3397,
326,
12040,
635,
3549,
3434,
1093,
6309,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
line() | line("else-open") | def compileNode(node, enableDebug=False): global indent global pretty if node.getChild("commentsBefore", False) != None: line() for comment in node.getChild("commentsBefore").children: # Additional new lines before big comment if comment.get("detail", False) == "multi": line() pretty += comment.get("text") # New line after singleline comment without line-ending if not comment.get("text").endswith("\n"): line() # Additional new lines after big comment elif comment.get("detail", False) == "multi": line() ################################################################## # Opening... ################################################################## if node.type == "map": if node.hasChildren(): line() pretty += "{" if node.hasChildren(): plus() line() elif node.type == "array": if node.hasChildren(): line() pretty += "[" if node.hasChildren(): plus() line() elif node.type == "block": line() pretty += "{" plus() line() elif node.type == "params": pretty += "(" elif node.type == "group": pretty += "(" elif node.type == "case": minus() line() pretty += "case " elif node.type == "catch": pretty += "catch" elif node.type == "finally": pretty += "finally" elif node.type == "delete": pretty += "delete " elif node.type == "break": pretty += "break" if node.get("label", False): pretty += " " + node.get("label", False) elif node.type == "continue": pretty += "continue" if node.get("label", False): pretty += " " + node.get("label", False) elif node.type == "elseStatement": line() pretty += "else" # This is a elseStatement without a block around (a set of {}) if not node.hasChild("block"): pretty += " " elif node.type == "switch" and node.get("switchType") == "case": pretty += "switch" elif node.type == "switch" and node.get("switchType") == "catch": pretty += "try" elif node.type == "throw": pretty += "throw " elif node.type == "instantiation": pretty += "new " elif node.type == "return": pretty += "return" if node.hasChildren(): pretty += " " elif node.type == "definitionList": pretty += "var " elif node.type == "default": minus() line() pretty += "default:" plus() line() elif node.type == "keyvalue": keyString = node.get("key") keyQuote = node.get("quotation", False) if keyQuote != None: # print "USE QUOTATION" if keyQuote == "doublequotes": keyString = '"' + keyString + '"' else: keyString = "'" + keyString + "'" elif keyString in config.JSPROTECTED or not KEY.match(keyString): print "ATTENTION: Auto protect key: %s" % keyString keyString = "\"" + keyString + "\"" pretty += keyString + " : " elif node.type == "expression": if node.parent.type == "loop": loopType = node.parent.get("loopType") if loopType == "DO": pretty += "while" # open expression block of IF/WHILE/DO-WHILE/FOR statements pretty += "(" elif node.parent.type == "catch": # open expression block of CATCH statement pretty += "(" elif node.parent.type == "switch" and node.parent.get("switchType") == "case": # open expression block of SWITCH statement pretty += "(" elif node.type == "loop": loopType = node.get("loopType") if loopType == "IF": pretty += "if" elif loopType == "WHILE": pretty += "while" elif loopType == "FOR": pretty += "for" elif loopType == "DO": pretty += "do" elif loopType == "WITH": pretty += "with" else: print "UNKNOWN LOOP TYPE: %s" % loopType elif node.type == "function": functionDeclHasParams = False pretty += "function" functionName = node.get("name", False) if functionName != None: pretty += " %s" % functionName elif node.type == "identifier": name = node.get("name", False) if name != None: pretty += name elif node.type == "call": callHasParams = False elif node.type == "definition": if node.parent.type != "definitionList": pretty += "var " pretty += node.get("identifier") elif node.type == "constant": if node.get("constantType") == "string": if node.get("detail") == "singlequotes": pretty += "'" else: pretty += '"' pretty += node.get("value") if node.get("detail") == "singlequotes": pretty += "'" else: pretty += '"' else: pretty += node.get("value") elif node.type == "third": if node.parent.type == "operation": if node.parent.get("operator") == "HOOK": pretty += " : " else: print "Unknown third argument... Not a hook" elif node.type == "labelTerminator": pretty += ":" ################################################################## # Children content ################################################################## if node.hasChildren(): childPosition = 1 childrenNumber = 0 # We need to ignore comment blocks # childrenNumber = len(node.children) for child in node.children: if child.type == "comment" or child.type == "commentsBefore": pass else: childrenNumber += 1 previousType = None for child in node.children: if child.type == "comment" or child.type == "commentsBefore": continue # Hints for close of node later if node.type == "call" and child.type == "params": callHasParams = True elif node.type == "function": if child.type == "params": functionDeclHasParams = True elif child.type == "body" and not functionDeclHasParams: # has no params before body, fix it here, and add body afterwards pretty += "()" functionDeclHasParams = True elif node.type == "definition" and child.type == "assignment": oper = child.get("operator", False) pretty += " " if oper != None: pretty += getTokenSource(oper) else: pretty += "=" pretty += " " elif node.type == "accessor" and child.type == "key": pretty += "[" elif node.type == "accessor" and child.type == "right": pretty += "." elif node.type == "loop" and node.get("loopType") == "FOR": if child.type == "first": pretty += "(" elif child.type == "statement": pretty += ")" else: if child.type == "second" and node.getChild("first", False) == None: pretty += "(" if child.type == "third" and node.getChild("first", False) == None and node.getChild("second", False) == None: pretty += "(" if not pretty.endswith(";") and not pretty.endswith("\n"): pretty += ";" elif node.type == "operation" and node.get("left", False) == "true": op = node.get("operator") if op == "TYPEOF": pretty += "typeof " elif op == None: print "BAD OPERATOR [A]: %s" % op else: pretty += getTokenSource(op) # Add child compileNode(child, enableDebug) if node.type == "operation" and child.type == "first" and node.get("left", False) != "true": op = node.get("operator") if op == "IN": pretty += " in " elif op == "INSTANCEOF": pretty += " instanceof " elif op == None: print "BAD OPERATOR [B]: %s" % op else: pretty += " " pretty += getTokenSource(op) pretty += " " elif node.type == "assignment" and child.type == "left": oper = node.get("operator", False) pretty += " " if oper != None: pretty += getTokenSource(oper) else: pretty += "=" pretty += " " elif node.type == "accessor" and child.type == "key": pretty += "]" # Separate children in parent list if childPosition < childrenNumber: if node.type == "variable": pretty += "." elif node.type == "map": pretty += ", " line() elif node.type == "array": pretty += ", " line() elif node.type == "definitionList": pretty += ", " elif node.type == "params": pretty += ", " elif node.type == "statementList": pretty += ", " separators = [ "block", "assignment", "call", "operation", "definition", "definitionList", "return", "break", "continue", "delete", "accessor", "instantiation", "throw", "variable", "function" ] not_after = [ "case", "default" ] not_in = [ "definitionList", "statementList", "params", "variable", "array" ] if node.type in [ "block", "file", "switch" ]: if not previousType in not_after: if child.type in separators: # pretty += "[[SEMI]]" semicolon() # not last child if childPosition == childrenNumber and node.type in [ "block", "switch", "file" ]: pass else: # pretty += "[[LINE]]" line() # Next... childPosition += 1 previousType = child.type ################################################################## # Closing... ################################################################## if node.type == "map": if node.hasChildren(): minus() line() pretty += "}" elif node.type == "array": if node.hasChildren(): minus() line() pretty += "]" elif node.type == "block": minus() line() pretty += "}" # Not it: # Function assignment if node.parent.type == "body" and node.parent.parent.type == "function" and node.parent.parent.parent.type == "right": pass else: line() elif node.type == "params": pretty += ")" elif node.type == "switch" and node.get("switchType") == "case": minus() minus() line() pretty += "}" # additional new line line() line() elif node.type == "group": pretty += ")" elif node.type == "case": pretty += ":" plus() line() elif node.type == "call" and not callHasParams: pretty += "()" elif node.type == "function" and not functionDeclHasParams: pretty += "()" elif node.type == "expression": if node.parent.type == "loop": pretty += ")" elif node.parent.type == "catch": pretty += ")" elif node.parent.type == "switch" and node.parent.get("switchType") == "case": pretty += ")" line() pretty += "{" plus() plus() elif node.type == "case": plus() line() | 9899d5c45563dd4f9057d173402244e0cf855c51 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5718/9899d5c45563dd4f9057d173402244e0cf855c51/prettyprint.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
907,
12,
2159,
16,
4237,
2829,
33,
8381,
4672,
225,
2552,
3504,
2552,
7517,
282,
309,
756,
18,
588,
1763,
2932,
9231,
4649,
3113,
1083,
13,
480,
599,
30,
980,
2932,
12107,
17,
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,
4074,
907,
12,
2159,
16,
4237,
2829,
33,
8381,
4672,
225,
2552,
3504,
2552,
7517,
282,
309,
756,
18,
588,
1763,
2932,
9231,
4649,
3113,
1083,
13,
480,
599,
30,
980,
2932,
12107,
17,
31... |
self.default = choices[0] | if default is not None and default in self.choices: self.default = self.keys[self.choices.index(default)] else: self.default = self.keys(0) | def __init__(self, keyword, choices): Param.__init__(self, keyword) self.choices = [entry[1] for entry in choices] self.keys = [entry[0] for entry in choices] self.default = choices[0] | 1f6160b06a4444687324525ba5d4c2d9892fbf5c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11522/1f6160b06a4444687324525ba5d4c2d9892fbf5c/userparams.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4932,
16,
7246,
4672,
3014,
16186,
2738,
972,
12,
2890,
16,
4932,
13,
365,
18,
11937,
273,
306,
4099,
63,
21,
65,
364,
1241,
316,
7246,
65,
365,
18,
24... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4932,
16,
7246,
4672,
3014,
16186,
2738,
972,
12,
2890,
16,
4932,
13,
365,
18,
11937,
273,
306,
4099,
63,
21,
65,
364,
1241,
316,
7246,
65,
365,
18,
24... |
else: self._leftAreaWidth = self.pwLeftArea.width() self.resizeTimer.start( 500 ) self.setSplitterPosition(self._leftAreaWidth, setDefault = False) | self.resizeTimer.start( 500 ) self.setSplitterPosition(self.splitterPosition, setDefault = False) | def resizeEvent(self, event): """ This reimplementation of QWidget.resizeEvent is here to deal with the undesired behavior of the splitter while resizing the part window. Normally, the splitter will drift back and forth while resizing the part window. This forces the splitter to stay fixed during resize operations. @note: This works well when resizing the window using border handles, but does'nt work at all for maximize/restore resizing (i.e. via the maximize/restore size buttons on the window border (or using F11/F12)). This is a bug. @see: L{_resizeTimeout()} """ if self.resizeTimer.isActive(): self.resizeTimer.stop() # Stop the timer. else: # We have no way to know if/when the user moved the splitter # position recently since QSplitter does not send the # 'splitterMoved' signal as advertized in the Qt documentation. # So we simply update _leftAreaWidth, which does the job # (sort of). # This works well when resizing the window using border handles, # but does'nt work at all for maximize/restore resizing (i.e. via # the maximize/restore size buttons on the window border # (or using F11/F12)). self._leftAreaWidth = self.pwLeftArea.width() self.resizeTimer.start( 500 ) # (Re)start a .5 second singleshot timer. self.setSplitterPosition(self._leftAreaWidth, setDefault = False) QWidget.resizeEvent(self, event) return | 78cee7d87681716c89c16ba27c2643c4f3449af4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/78cee7d87681716c89c16ba27c2643c4f3449af4/Ui_PartWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
1133,
12,
2890,
16,
871,
4672,
3536,
1220,
283,
30810,
434,
2238,
4609,
18,
15169,
1133,
353,
2674,
358,
10490,
598,
326,
640,
30458,
6885,
434,
326,
21553,
1323,
400,
6894,
326,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7041,
1133,
12,
2890,
16,
871,
4672,
3536,
1220,
283,
30810,
434,
2238,
4609,
18,
15169,
1133,
353,
2674,
358,
10490,
598,
326,
640,
30458,
6885,
434,
326,
21553,
1323,
400,
6894,
326,
1... |
return "Rule (map %s):: %s" % ( self.standardized_mapping, self.consequent) | return "Rule (map %s):: %s" % (self.varmap, self.consequent) | def __str__( self ): if len(self.antecedents) > 0: antstr = [str(x) for x in self.antecedents] return "Rule (map %s):: %s <- %s" % ( self.standardized_mapping, self.consequent, antstr) else: return "Rule (map %s):: %s" % ( self.standardized_mapping, self.consequent) | 4c11f87c46e68caaf61290f0e699940ee52ad8b4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6444/4c11f87c46e68caaf61290f0e699940ee52ad8b4/prolog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
365,
262,
30,
309,
562,
12,
2890,
18,
7974,
3263,
4877,
13,
405,
374,
30,
17841,
701,
273,
306,
701,
12,
92,
13,
364,
619,
316,
365,
18,
7974,
3263,
4877,
65,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
701,
972,
12,
365,
262,
30,
309,
562,
12,
2890,
18,
7974,
3263,
4877,
13,
405,
374,
30,
17841,
701,
273,
306,
701,
12,
92,
13,
364,
619,
316,
365,
18,
7974,
3263,
4877,
65,
3... |
_python25 = sys.version.split()[0] > '2.4' | def get(self): log.warning('Deprecated call to YieldCallback.get(); use get_result() instead') return InProgress.get_result(self) | f1bce322fa1331eb13c1073f768e09ac92f04f21 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11722/f1bce322fa1331eb13c1073f768e09ac92f04f21/yieldfunc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
12,
2890,
4672,
613,
18,
8551,
2668,
13534,
745,
358,
31666,
2428,
18,
588,
5621,
999,
336,
67,
2088,
1435,
3560,
6134,
327,
657,
5491,
18,
588,
67,
2088,
12,
2890,
13,
225,
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,
336,
12,
2890,
4672,
613,
18,
8551,
2668,
13534,
745,
358,
31666,
2428,
18,
588,
5621,
999,
336,
67,
2088,
1435,
3560,
6134,
327,
657,
5491,
18,
588,
67,
2088,
12,
2890,
13,
225,
2,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.