rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
self.Ttest2 = r.linear_hypothesis(self.R_Results['F'], r.c('x.5 = x.6',)) t = np.inner(self.R, self.res1.params)/\ (np.sign(np.inner(self.R, self.res1.params))*\ np.sqrt(self.Ttest2['F'][1])) | self.Ttest2 = r.linear_hypothesis(self.R_Results, 'x.5 = x.6') t = np.sign(np.inner(self.R, self.res1.params))*\ np.sqrt(self.Ttest2['F'][1]) | def setup(self): if skipR: raise SkipTest, "Rpy not installed" try: r.library('car') except RPy_RException: raise SkipTest, "car library not installed for R" R = np.zeros(len(self.res1.params)) R[4:6] = [1,-1] self.R = R self.Ttest1 = self.res1.t_test(self.R) self.R_Results = RModel(self.data.endog, self.data.exog, r.lm).robj self.Ttest2 = r.linear_hypothesis(self.R_Results['F'], r.c('x.5 = x.6',)) t = np.inner(self.R, self.res1.params)/\ (np.sign(np.inner(self.R, self.res1.params))*\ np.sqrt(self.Ttest2['F'][1])) self.t = t effect = np.inner(self.R, self.res1.params) self.effect = effect | c944eab8d84c6cac2fb5de055fceb6bc5953418f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12658/c944eab8d84c6cac2fb5de055fceb6bc5953418f/test_regression.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
4672,
309,
2488,
54,
30,
1002,
6611,
4709,
16,
315,
54,
2074,
486,
5876,
6,
775,
30,
436,
18,
12083,
2668,
9815,
6134,
1335,
534,
9413,
67,
54,
503,
30,
1002,
6611,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
4672,
309,
2488,
54,
30,
1002,
6611,
4709,
16,
315,
54,
2074,
486,
5876,
6,
775,
30,
436,
18,
12083,
2668,
9815,
6134,
1335,
534,
9413,
67,
54,
503,
30,
1002,
6611,
4... |
schedIdList.append( job.runningJob['schedulerId'] ) | if not schedIdList.has_key( job.runningJob['service'] ) : schedIdList[job.runningJob['service']] = [] schedIdList[job.runningJob['service']].append( job.runningJob['schedulerId'] ) | def getOutput( self, obj, outdir ): """ retrieve output or just put it in the destination directory """ | 689e69b9c0c8dd87a02476947696c45b1a5a5800 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/689e69b9c0c8dd87a02476947696c45b1a5a5800/Scheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11062,
12,
365,
16,
1081,
16,
15398,
262,
30,
3536,
4614,
876,
578,
2537,
1378,
518,
316,
326,
2929,
1867,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11062,
12,
365,
16,
1081,
16,
15398,
262,
30,
3536,
4614,
876,
578,
2537,
1378,
518,
316,
326,
2929,
1867,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
for x in self.settings["embedded/rm"]: print "Removing "+x os.system("rm -rf "+self.settings["chroot_path"]+"/tmp/mergeroot"+x) | for x in self.settings["embedded/rm"]: print "Removing "+x os.system("rm -rf "+self.settings["chroot_path"]+"/tmp/mergeroot"+x) | def clean(self): if self.settings.has_key("embedded/rm"): if type(self.settings["embedded/rm"])==types.StringType: self.settings["embedded/rm"]=[self.settings["embedded/rm"]] print "Removing directories from image" for x in self.settings["embedded/rm"]: print "Removing "+x os.system("rm -rf "+self.settings["chroot_path"]+"/tmp/mergeroot"+x) | 174272f3cab1885c032298a60fea31ba7fc6d2ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7327/174272f3cab1885c032298a60fea31ba7fc6d2ae/targets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
2890,
4672,
309,
365,
18,
4272,
18,
5332,
67,
856,
2932,
20722,
19,
8864,
6,
4672,
309,
618,
12,
2890,
18,
4272,
9614,
20722,
19,
8864,
6,
5717,
631,
2352,
18,
780,
559,
30... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2721,
12,
2890,
4672,
309,
365,
18,
4272,
18,
5332,
67,
856,
2932,
20722,
19,
8864,
6,
4672,
309,
618,
12,
2890,
18,
4272,
9614,
20722,
19,
8864,
6,
5717,
631,
2352,
18,
780,
559,
30... |
def test_parse_qs(): | def test_parse_querystring(): | def test_parse_qs(): e = {'QUERY_STRING': 'a=1&b=2&c=3&b=4'} d = parse_qs(e) assert d == [('a', '1'), ('b', '2'), ('c', '3'), ('b', '4')] assert e['paste._cached_parse_qs'] == ( (e['QUERY_STRING'], d)) e = {'QUERY_STRING': 'a&b&c=&d=1'} d = parse_qs(e) assert d == [('a', None), ('b', None), ('c', ''), ('d', '1')] | 76da4633eae92f618adf40d530f340fa27a71d98 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2097/76da4633eae92f618adf40d530f340fa27a71d98/test_request_form.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2670,
67,
2271,
1080,
13332,
425,
273,
13666,
10753,
67,
5804,
4278,
296,
69,
33,
21,
10,
70,
33,
22,
10,
71,
33,
23,
10,
70,
33,
24,
11,
97,
302,
273,
1109,
67,
12926,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2670,
67,
2271,
1080,
13332,
425,
273,
13666,
10753,
67,
5804,
4278,
296,
69,
33,
21,
10,
70,
33,
22,
10,
71,
33,
23,
10,
70,
33,
24,
11,
97,
302,
273,
1109,
67,
12926,
... |
href = self.code_value(stream) if pre: href = ' | def process_code_link(self, stream, pre=''): text = u'' | 94a11a8c56fd02fa065c3e0800df20d37aaa6cfa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9125/94a11a8c56fd02fa065c3e0800df20d37aaa6cfa/pmlconverter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
710,
67,
1232,
12,
2890,
16,
1407,
16,
675,
2218,
11,
4672,
977,
273,
582,
6309,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
710,
67,
1232,
12,
2890,
16,
1407,
16,
675,
2218,
11,
4672,
977,
273,
582,
6309,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
if err[0] == errno.EINTR: | err_type = err.message if err_type == errno.EINTR: | def _read(self): buf = '' # put in a loop so that we retry on transient errors while True: try: buf = self._ssl.read(self._bufsize) except socket.sslerror as err: if (err[0] == socket.SSL_ERROR_WANT_READ or err[0] == socket.SSL_ERROR_WANT_WRITE): continue if (err[0] == socket.SSL_ERROR_ZERO_RETURN or err[0] == socket.SSL_ERROR_EOF): break raise except socket.error as err: if err[0] == errno.EINTR: continue if err[0] == errno.EBADF: # XXX socket was closed? break raise else: break return buf | 495cdb0087a23582cf0d23523fdb2653128103b7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/495cdb0087a23582cf0d23523fdb2653128103b7/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
12,
2890,
4672,
1681,
273,
875,
468,
1378,
316,
279,
2798,
1427,
716,
732,
3300,
603,
12315,
1334,
1323,
1053,
30,
775,
30,
1681,
273,
365,
6315,
8157,
18,
896,
12,
2890,
631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
896,
12,
2890,
4672,
1681,
273,
875,
468,
1378,
316,
279,
2798,
1427,
716,
732,
3300,
603,
12315,
1334,
1323,
1053,
30,
775,
30,
1681,
273,
365,
6315,
8157,
18,
896,
12,
2890,
631... |
while 1 and self.__initialized: self.__connectionSemaphore.release() try: connection = self.__connectionQueue.get_nowait() connection.close() except Queue.Empty,x: self.logger.debug( 'No more connection in Queue' ) break if instances == 1: MySQLdb.server_end() instances -= 1 | try: while 1 and self.__initialized: self.__connectionSemaphore.release() try: connection = self.__connectionQueue.get_nowait() connection.close() except Queue.Empty, x: self.logger.debug( 'No more connection in Queue' ) break if instances == 1: MySQLdb.server_end() instances -= 1 except: pass | def __del__( self ): global instances | 0e53f5944800e7e4e2a93a0c3f1aefa6be7f7b08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/0e53f5944800e7e4e2a93a0c3f1aefa6be7f7b08/MySQL.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
365,
262,
30,
2552,
3884,
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,
1001,
3771,
972,
12,
365,
262,
30,
2552,
3884,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
menuTitle = _(u'Keep "%(collection)s" out of %(kidashboardnd)s') % arguments | menuTitle = _(u'Keep "%(collection)s" out of %(dashboard)s') % arguments | def onToggleMineEventUpdateUI(self, event): selectedItem = second = None iterator = self.contents.iterSelection() try: selectedItem = iterator.next() second = iterator.next() except StopIteration: pass if selectedItem is None or second is not None: event.arguments['Enable'] = False else: collectionName = selectedItem.getItemDisplayName() | f79c7acb18fce024b12771935ebf7c08664abfc0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/f79c7acb18fce024b12771935ebf7c08664abfc0/SideBar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
17986,
49,
558,
1133,
1891,
5370,
12,
2890,
16,
871,
4672,
3170,
1180,
273,
2205,
273,
599,
2775,
273,
365,
18,
3980,
18,
2165,
6233,
1435,
775,
30,
3170,
1180,
273,
2775,
18,
428... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
17986,
49,
558,
1133,
1891,
5370,
12,
2890,
16,
871,
4672,
3170,
1180,
273,
2205,
273,
599,
2775,
273,
365,
18,
3980,
18,
2165,
6233,
1435,
775,
30,
3170,
1180,
273,
2775,
18,
428... |
sage: print A | sage: A | def clear_cells(self): """ Mark every cell in self as being empty. | 0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0d333d6beb48cce2a6cb9f6c18b5d14e9b0765b2/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
67,
14741,
12,
2890,
4672,
3536,
6622,
3614,
2484,
316,
365,
487,
3832,
1008,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
67,
14741,
12,
2890,
4672,
3536,
6622,
3614,
2484,
316,
365,
487,
3832,
1008,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
doc_entry = client.Post(new_entry, '/feeds/documents/private/full') | folder_entries = client.get_folder(options.folder) folder_entry = client.get_single_entry(folder_entries) if folder_entry: post_uri = folder_entry.content.src else: post_uri = '/feeds/documents/private/full' doc_entry = client.Post(new_entry, post_uri) | def _run_edit(client, options, args): doc_entry = client.get_single_doc(options.title, options.folder) if not hasattr(client, 'Export'): print 'Editing documents is not supported' +\ ' for gdata-python-client < 2.0' return if not doc_entry: print 'No matching documents found! Creating it.' new_entry = gdata.docs.DocumentListEntry() new_entry.title = gdata.atom.Title(text=options.title or 'GoogleCL doc') category = client._MakeKindCategory(DOCUMENT_LABEL) new_entry.category.append(category) doc_entry = client.Post(new_entry, '/feeds/documents/private/full') doc_type = get_document_type(doc_entry) # Spreadsheet exporting is still broken (on the client library side) # so we can't let users specify spreadsheets. if doc_type == SPREADSHEET_LABEL: print 'Sorry, cannot edit or download spreadsheets.' return else: format_ext = options.format or get_extension(doc_type) editor = options.editor or get_editor(doc_type) if not editor: print 'No editor defined!' print 'Define an "editor" option in your config file, set the ' +\ 'EDITOR environment variable, or pass an editor in with --editor.' return client.edit_doc(doc_entry, editor, format_ext) | c39b8a9627de0edfb3d799d2d03eab92d3ba2b20 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2899/c39b8a9627de0edfb3d799d2d03eab92d3ba2b20/service.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2681,
67,
4619,
12,
2625,
16,
702,
16,
833,
4672,
997,
67,
4099,
273,
1004,
18,
588,
67,
7526,
67,
2434,
12,
2116,
18,
2649,
16,
702,
18,
5609,
13,
309,
486,
3859,
12,
2625,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2681,
67,
4619,
12,
2625,
16,
702,
16,
833,
4672,
997,
67,
4099,
273,
1004,
18,
588,
67,
7526,
67,
2434,
12,
2116,
18,
2649,
16,
702,
18,
5609,
13,
309,
486,
3859,
12,
2625,
1... |
attrNames.append('Status') attrValues.append(status) | attrNames.append( 'Status' ) attrValues.append( status ) | def setJobStatus(self,jobID,status='',minor='',application='',appCounter=None): """ Set status of the job specified by its jobID """ | 99c1bc850ba087890925b3180df206f65bb1d4b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/99c1bc850ba087890925b3180df206f65bb1d4b3/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
23422,
12,
2890,
16,
4688,
734,
16,
2327,
2218,
2187,
17364,
2218,
2187,
3685,
2218,
2187,
2910,
4789,
33,
7036,
4672,
3536,
1000,
1267,
434,
326,
1719,
1269,
635,
2097,
28913,
3536,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
23422,
12,
2890,
16,
4688,
734,
16,
2327,
2218,
2187,
17364,
2218,
2187,
3685,
2218,
2187,
2910,
4789,
33,
7036,
4672,
3536,
1000,
1267,
434,
326,
1719,
1269,
635,
2097,
28913,
3536,
... |
<p>%s</p> | %s | def termlist(self): """Term List for html doc""" c_ids, p_ids = self.vocab.azlist() tl = """<div class="termlist">""" tl = """%s<h3>Classes and Properties (full detail)</h3><div class='termdetails'><br />\n\n""" % tl # first classes, then properties eg = """<div class="specterm" id="term_%s"> <h3>%s: %s</h3> <em>%s</em> - %s <br /><table style="th { float: top; }"> <tr><th>Status:</th> <td>%s</td></tr> %s %s </table> <p>%s</p> <p style="float: right; font-size: small;">[<a href="#glance">back to top</a>]</p> <br/> </div>""" | a521a3b6e2b37f6fab70523c9010ca3760cda7ea /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3661/a521a3b6e2b37f6fab70523c9010ca3760cda7ea/libvocab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19272,
781,
376,
12,
2890,
4672,
3536,
4065,
987,
364,
1729,
997,
8395,
276,
67,
2232,
16,
293,
67,
2232,
273,
365,
18,
15913,
18,
1561,
1098,
1435,
8332,
273,
3536,
32,
2892,
667,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19272,
781,
376,
12,
2890,
4672,
3536,
4065,
987,
364,
1729,
997,
8395,
276,
67,
2232,
16,
293,
67,
2232,
273,
365,
18,
15913,
18,
1561,
1098,
1435,
8332,
273,
3536,
32,
2892,
667,
154... |
focusRange = float(self.getEntryNum(self.focusRangeWdg, "Focus Range")) | focusRange = float(self.getEntryNum(self.focusRangeWdg, "Focus Range")) | def waitFocusSweep(self): """Conduct a focus sweep. Sets sr.value to True if successful. """ sr = self.sr | bdc20e03649e5a498573c69cad551b250ac0bc28 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6236/bdc20e03649e5a498573c69cad551b250ac0bc28/BaseFocusScript.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2529,
9233,
55,
25236,
12,
2890,
4672,
3536,
442,
1828,
279,
7155,
17462,
18,
225,
11511,
9133,
18,
1132,
358,
1053,
309,
6873,
18,
3536,
9133,
273,
365,
18,
11254,
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,
2529,
9233,
55,
25236,
12,
2890,
4672,
3536,
442,
1828,
279,
7155,
17462,
18,
225,
11511,
9133,
18,
1132,
358,
1053,
309,
6873,
18,
3536,
9133,
273,
365,
18,
11254,
2,
-100,
-100,
-100,
... |
always = True | self.always = True | def save(self, text, page, comment, minorEdit=True, botflag=True): # only save if something was changed if text != page.get(): # Show the title of the page we're working on. # Highlight the title in purple. pywikibot.output(u"\n\n>>> \03{lightpurple}%s\03{default} <<<" % page.title()) # show what was changed pywikibot.showDiff(page.get(), text) pywikibot.output(u'Comment: %s' %comment) if not self.dry: if not self.always: choice = pywikibot.inputChoice( u'Do you want to accept these changes?', ['Yes', 'No', 'Always', 'Quit'], ['y', 'N', 'a', 'q'], 'N') if choice == 'a': always = True elif choice == 'q': import sys sys.exit() if self.always or choice == 'y': try: # Save the page page.put(text, comment=comment, minorEdit=minorEdit, botflag=botflag) except pywikibot.LockedPage: pywikibot.output(u"Page %s is locked; skipping." % page.title(asLink=True)) except pywikibot.EditConflict: pywikibot.output( u'Skipping %s because of edit conflict' % (page.title())) except pywikibot.SpamfilterError, error: pywikibot.output( | 1c05adc98f14f29e2297cfcb04c033d22613f3ca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/1c05adc98f14f29e2297cfcb04c033d22613f3ca/commonscat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
977,
16,
1363,
16,
2879,
16,
8439,
4666,
33,
5510,
16,
2512,
6420,
33,
5510,
4672,
468,
1338,
1923,
309,
5943,
1703,
3550,
309,
977,
480,
1363,
18,
588,
13332,
468,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
977,
16,
1363,
16,
2879,
16,
8439,
4666,
33,
5510,
16,
2512,
6420,
33,
5510,
4672,
468,
1338,
1923,
309,
5943,
1703,
3550,
309,
977,
480,
1363,
18,
588,
13332,
468,... |
self.assertEqual(LI.LoadImages().variable_revision_number,2,"LoadImages' version number has changed") | self.assertEqual(LI.LoadImages().variable_revision_number,3,"LoadImages' version number has changed") | def test_00_01version(self): self.assertEqual(LI.LoadImages().variable_revision_number,2,"LoadImages' version number has changed") | 1842279c159b85f8be31eabf25aea8d9a9f09b54 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2870/1842279c159b85f8be31eabf25aea8d9a9f09b54/test_loadimages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
713,
67,
1611,
1589,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
2053,
18,
2563,
8946,
7675,
6105,
67,
13057,
67,
2696,
16,
23,
10837,
2563,
8946,
11,
1177,
1300,
711,
3550,
79... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
713,
67,
1611,
1589,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
2053,
18,
2563,
8946,
7675,
6105,
67,
13057,
67,
2696,
16,
23,
10837,
2563,
8946,
11,
1177,
1300,
711,
3550,
79... |
def stringToControl(s): | def stringToControl(s, safe=False): | def stringToControl(s): try: wx.USE_UNICODE, UnicodeError except (AttributeError, NameError): return s if wx.USE_UNICODE: try: return unicode(s) except UnicodeError, err: try: spec = coding_spec(s) return s.decode(spec) except UnicodeError, err: raise Exception, 'Unable to decode unicode string, please change '\ 'the defaultencoding in sitecustomize.py to handle this '\ 'encoding.\n Error message %s'%str(err) else: return s | 2880a79b57fa42c3ae86a32a9f44503e1df55435 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/2880a79b57fa42c3ae86a32a9f44503e1df55435/Utils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14134,
3367,
12,
87,
16,
4183,
33,
8381,
4672,
775,
30,
7075,
18,
8001,
67,
26642,
16,
9633,
668,
1335,
261,
1499,
668,
16,
25473,
4672,
327,
272,
225,
309,
7075,
18,
8001,
67,
26642,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
14134,
3367,
12,
87,
16,
4183,
33,
8381,
4672,
775,
30,
7075,
18,
8001,
67,
26642,
16,
9633,
668,
1335,
261,
1499,
668,
16,
25473,
4672,
327,
272,
225,
309,
7075,
18,
8001,
67,
26642,
... |
return [x[0].explain() for x in self.usedRules] | result = [x[0].explain() for x in self.usedRules] if any(x[0].debug for x in self.usedRules): result.append(str(self)) return result | def explain(self): return [x[0].explain() for x in self.usedRules] | 5c6cb8467d499ebc4f002edf9d98b275f5ff2dbc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1679/5c6cb8467d499ebc4f002edf9d98b275f5ff2dbc/scoringengine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19765,
12,
2890,
4672,
327,
306,
92,
63,
20,
8009,
338,
7446,
1435,
364,
619,
316,
365,
18,
3668,
4478,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
19765,
12,
2890,
4672,
327,
306,
92,
63,
20,
8009,
338,
7446,
1435,
364,
619,
316,
365,
18,
3668,
4478,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
print "STATUS: Versions are the same. No upgrade necessary." | print "Status: Versions are the same. No upgrade necessary." | #print "WARNING: cannot upgrade %s. upgrade def not found. skipping" % \ | af98851618b632afb0a950644c796b7c633ace40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7598/af98851618b632afb0a950644c796b7c633ace40/upgrade-db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
1188,
315,
9511,
30,
2780,
8400,
738,
87,
18,
8400,
1652,
486,
1392,
18,
14195,
6,
738,
521,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
1188,
315,
9511,
30,
2780,
8400,
738,
87,
18,
8400,
1652,
486,
1392,
18,
14195,
6,
738,
521,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
print(self.type + b" " + self.path.encode('utf-8') + b" " + self.version) | logger.debug(self.type + b" " + self.path.encode('utf-8') + b" " + self.version) | def print(self): print(self.type + b" " + self.path.encode('utf-8') + b" " + self.version) for i in self.headers: print(i + b":" + self.headers[i]) | 6503db549e45c7b35361eac9e4aa36af968eb65e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8801/6503db549e45c7b35361eac9e4aa36af968eb65e/http.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
12,
2890,
4672,
1194,
18,
4148,
12,
2890,
18,
723,
397,
324,
6,
315,
397,
365,
18,
803,
18,
3015,
2668,
3158,
17,
28,
6134,
397,
324,
6,
315,
397,
365,
18,
1589,
13,
364,
277... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1172,
12,
2890,
4672,
1194,
18,
4148,
12,
2890,
18,
723,
397,
324,
6,
315,
397,
365,
18,
803,
18,
3015,
2668,
3158,
17,
28,
6134,
397,
324,
6,
315,
397,
365,
18,
1589,
13,
364,
277... |
if (err[0] == socket.SSL_ERROR_ZERO_RETURN or err[0] == socket.SSL_ERROR_EOF): | if (err_type == socket.SSL_ERROR_ZERO_RETURN or err_type == socket.SSL_ERROR_EOF): | def _read(self): buf = '' # put in a loop so that we retry on transient errors while True: try: buf = self._ssl.read(self._bufsize) except socket.sslerror as err: if (err[0] == socket.SSL_ERROR_WANT_READ or err[0] == socket.SSL_ERROR_WANT_WRITE): continue if (err[0] == socket.SSL_ERROR_ZERO_RETURN or err[0] == socket.SSL_ERROR_EOF): break raise except socket.error as err: if err[0] == errno.EINTR: continue if err[0] == errno.EBADF: # XXX socket was closed? break raise else: break return buf | 80a93034fe2b56c4178335fafeb9141619e29d63 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3187/80a93034fe2b56c4178335fafeb9141619e29d63/httplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
12,
2890,
4672,
1681,
273,
875,
468,
1378,
316,
279,
2798,
1427,
716,
732,
3300,
603,
12315,
1334,
1323,
1053,
30,
775,
30,
1681,
273,
365,
6315,
8157,
18,
896,
12,
2890,
631... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
896,
12,
2890,
4672,
1681,
273,
875,
468,
1378,
316,
279,
2798,
1427,
716,
732,
3300,
603,
12315,
1334,
1323,
1053,
30,
775,
30,
1681,
273,
365,
6315,
8157,
18,
896,
12,
2890,
631... |
rec.set({"ana_id": 1, "B01001": 12, "B01002": 123, "B01019": "Test of long station name"}) | rec.set({"ana_id": 1, "B01001": 12, "B01002": 123, "B01019": "Test of long station name", "rep_cod": 1}) | def setUp(self): # We want a predictable dataset random.seed(1) rattr = random.Random() rattr.seed(1) | 861e944c912b0723d3932eb6c9e6cd1af1f59e5c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2863/861e944c912b0723d3932eb6c9e6cd1af1f59e5c/test-volnd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
468,
1660,
2545,
279,
7810,
429,
3709,
2744,
18,
12407,
12,
21,
13,
436,
1747,
273,
2744,
18,
8529,
1435,
436,
1747,
18,
12407,
12,
21,
13,
2,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24292,
12,
2890,
4672,
468,
1660,
2545,
279,
7810,
429,
3709,
2744,
18,
12407,
12,
21,
13,
436,
1747,
273,
2744,
18,
8529,
1435,
436,
1747,
18,
12407,
12,
21,
13,
2,
-100,
-100,
-100,
... |
elif pattern[index] == 'sS': | elif pattern[index] in 'sS': | def compile(pattern, flags=0): stack = [] index = 0 label = 0 register = 1 groupindex = {} callouts = [] while (index < len(pattern)): char = pattern[index] index = index + 1 if char == '\\': if index < len(pattern): next = pattern[index] index = index + 1 if next == 't': stack.append([Exact(chr(9))]) elif next == 'n': stack.append([Exact(chr(10))]) elif next == 'r': stack.append([Exact(chr(13))]) elif next == 'f': stack.append([Exact(chr(12))]) elif next == 'a': stack.append([Exact(chr(7))]) elif next == 'e': stack.append([Exact(chr(27))]) elif next in '0123456789': value = next while (index < len(pattern)) and \ (pattern[index] in string.digits): value = value + pattern[index] index = index + 1 if (len(value) == 3) or \ ((len(value) == 2) and (value[0] == '0')): value = string.atoi(value, 8) if value > 255: raise error, 'octal char out of range' stack.append([Exact(chr(value))]) elif value == '0': stack.append([Exact(chr(0))]) elif len(value) > 3: raise error, 'too many digits' else: value = string.atoi(value) if value >= register: raise error, ('cannot reference a register ' 'not yet used') elif value == 0: raise error, ('register 0 cannot be used ' 'during match') stack.append([MatchMemory(value)]) elif next == 'x': value = '' while (index < len(pattern)) and \ (pattern[index] in string.hexdigits): value = value + pattern[index] index = index + 1 value = string.atoi(value, 16) if value > 255: raise error, 'hex char out of range' stack.append([Exact(chr(value))]) elif next == 'c': if index >= len(pattern): raise error, '\\c at end of re' elif pattern[index] in 'abcdefghijklmnopqrstuvwxyz': stack.append(Exact(chr(ord(pattern[index]) - ord('a') + 1))) else: stack.append(Exact(chr(ord(pattern[index]) ^ 64))) index = index + 1 elif next == 'A': stack.append([BegBuf()]) elif next == 'Z': stack.append([EndBuf()]) elif next == 'b': stack.append([WordBound()]) elif next == 'B': stack.append([NotWordBound()]) elif next == 'w': stack.append([SyntaxSpec('word')]) elif next == 'W': stack.append([NotSyntaxSpec('word')]) elif next == 's': stack.append([SyntaxSpec('whitespace')]) elif next == 'S': stack.append([NotSyntaxSpec('whitespace')]) elif next == 'd': stack.append([SyntaxSpec('digit')]) elif next == 'D': stack.append([NotSyntaxSpec('digit')]) elif next in 'GluLUQE': # some perl-isms that we don't support raise error, '\\' + next + ' not supported' else: stack.append([Exact(pattern[index])]) else: raise error, 'backslash at the end of a string' elif char == '|': if len(stack) == 0: raise error, 'nothing to alternate' expr = [] while (len(stack) != 0) and \ (stack[-1][0].name != '(') and \ (stack[-1][0].name != '|'): expr = stack[-1] + expr del stack[-1] stack.append([FailureJump(label)] + \ expr + \ [Jump(-1), Label(label)]) stack.append([('|',)]) label = label + 1 elif char == '(': if index >= len(pattern): raise error, 'no matching close paren' elif pattern[index] == '?': # Perl style (?...) extensions index = index + 1 if index >= len(pattern): raise error, 'extension ends prematurely' elif pattern[index] == 'P': # Python extensions index = index + 1 if index >= len(pattern): raise error, 'extension ends prematurely' elif pattern[index] == '<': # Handle Python symbolic group names (?<...>...) index = index + 1 end = string.find(pattern, '>', index) if end == -1: raise error, 'no end to symbolic group name' name = pattern[index:end] # XXX check syntax of name index = end + 1 groupindex[name] = register stack.append([OpenParen(register)]) register = register + 1 elif pattern[index] == '=': # backreference to symbolic group name if index >= len(pattern): raise error, '(?P= at the end of the pattern' start = index + 1 end = string.find(pattern, ')', start) if end == -1: raise error, 'no ) to end symbolic group name' name = pattern[start:end] if name not in groupindex: raise error, ('symbolic group name ' + name + \ ' has not been used yet') stack.append([MatchMemory(groupindex[name])]) index = end + 1 elif pattern[index] == '!': # function callout if index >= len(pattern): raise error, 'no function callout name' start = index + 1 end = string.find(pattern, ')', start) if end == -1: raise error, 'no ) to end function callout name' name = pattern[start:end] if name not in callouts: raise error, ('function callout name not listed ' 'in callouts dict') stack.append([FunctionCallout(name)]) else: raise error, 'unknown Python extension' elif pattern[index] == ':': # grouping, but no registers index = index + 1 stack.append([('(', -1)]) elif pattern[index] == '#': # comment index = index + 1 end = string.find(pattern, ')', index) if end == -1: raise error, 'no end to comment' index = end + 1 elif pattern[index] == '=': raise error, ('zero-width positive lookahead ' 'assertion is unsupported') elif pattern[index] == '!': raise error, ('zero-width negative lookahead ' 'assertion is unsupported') elif pattern[index] in 'iImMsSxX': while (index < len(pattern)) and (pattern[index] != ')'): if pattern[index] == 'iI': flags = flags | IGNORECASE elif pattern[index] == 'mM': flags = flags | MULTILINE elif pattern[index] == 'sS': flags = flags | DOTALL elif pattern[index] in 'xX': flags = flags | VERBOSE else: raise error, 'unknown flag' index = index + 1 index = index + 1 else: raise error, 'unknown extension' else: stack.append([OpenParen(register)]) register = register + 1 elif char == ')': # make one expression out of everything on the stack up to # the marker left by the last parenthesis expr = [] while (len(stack) > 0) and (stack[-1][0].name != '('): expr = stack[-1] + expr del stack[-1] if len(stack) == 0: raise error, 'too many close parens' if len(expr) == 0: raise error, 'nothing inside parens' # check to see if alternation used correctly if (expr[-1].name == '|'): raise error, 'alternation with nothing on the right' # remove markers left by alternation expr = filter(lambda x: x.name != '|', expr) # clean up jumps inserted by alternation need_label = 0 for i in range(len(expr)): if (expr[i].name == 'jump') and (expr[i].label == -1): expr[i] = JumpOpcode(label) need_label = 1 if need_label: expr.append(Label(label)) label = label + 1 if stack[-1][0].register > 0: expr = [StartMemory(stack[-1][0].register)] + \ expr + \ [EndMemory(stack[-1][0].register)] del stack[-1] stack.append(expr) elif char == '{': if len(stack) == 0: raise error, 'no expression to repeat' end = string.find(pattern, '}', index) if end == -1: raise error, ('no close curly bracket to match' ' open curly bracket') fields = map(string.strip, string.split(pattern[index:end], ',')) index = end + 1 minimal = 0 if (index < len(pattern)) and (pattern[index] == '?'): minimal = 1 index = index + 1 if len(fields) == 1: # {n} or {n}? (there's really no difference) try: count = string.atoi(fields[0]) except ValueError: raise error, ('count must be an integer ' 'inside curly braces') if count > 65535: raise error, 'repeat count out of range' expr = [] while count > 0: expr = expr + stack[-1] count = count - 1 del stack[-1] stack.append(expr) elif len(fields) == 2: # {n,} or {n,m} if fields[1] == '': # {n,} try: min = string.atoi(fields[0]) except ValueError: raise error, ('minimum must be an integer ' 'inside curly braces') if min > 65535: raise error, 'minimum repeat count out of range' expr = [] while min > 0: expr = expr + stack[-1] min = min - 1 registers = registers_used(stack[-1]) if minimal: expr = expr + \ ([Jump(label + 1), Label(label)] + \ stack[-1] + \ [Label(label + 1), FailureJump(label, registers)]) else: expr = expr + \ ([Label(label), FailureJump(label + 1, registers)] + stack[-1] + [StarJump(label), Label(label + 1)]) del stack[-1] stack.append(expr) label = label + 2 else: # {n,m} try: min = string.atoi(fields[0]) except ValueError: raise error, ('minimum must be an integer ' 'inside curly braces') try: max = string.atoi(fields[1]) except ValueError: raise error, ('maximum must be an integer ' 'inside curly braces') if min > 65535: raise error, ('minumim repeat count out ' 'of range') if max > 65535: raise error, ('maximum repeat count out ' 'of range') if min > max: raise error, ('minimum repeat count must be ' 'less than the maximum ' 'repeat count') expr = [] while min > 0: expr = expr + stack[-1] min = min - 1 max = max - 1 if minimal: while max > 0: expr = expr + \ [FailureJump(label), Jump(label + 1), Label(label)] + \ stack[-1] + \ [Label(label + 1)] label = label + 2 del stack[-1] stack.append(expr) else: while max > 0: expr = expr + \ [FailureJump(label)] + \ stack[-1] max = max - 1 del stack[-1] stack.append(expr + [Label(label)]) label = label + 1 else: raise error, ('there need to be one or two fields ' 'in a {} expression') index = end + 1 elif char == '}': raise error, 'unbalanced close curly brace' elif char == '*': # Kleene closure if len(stack) == 0: raise error, 'the Kleene closure needs something to repeat' registers = registers_used(stack[-1]) if (index < len(pattern)) and (pattern[index] == '?'): # non-greedy matching expr = [JumpInstructions(label + 1), Label(label)] + \ stack[-1] + \ [Label(label + 1), FailureJump(label)] index = index + 1 else: # greedy matching expr = [Label(label), FailureJump(label + 1)] + \ stack[-1] + \ [StarJump(label), Label(label + 1)] del stack[-1] stack.append(expr) label = label + 2 elif char == '+': # positive closure if len(stack) == 0: raise error, 'the positive closure needs something to repeat' registers = registers_used(stack[-1]) if (index < len(pattern)) and (pattern[index] == '?'): # non-greedy expr = [Label(label)] + \ stack[-1] + \ [FailureJump(label)] label = label + 1 index = index + 1 else: # greedy expr = [DummyFailureJump(label + 1), Label(label), FailureJump(label + 2), Label(label + 1)] + \ stack[-1] + \ [StarJump(label), Label(label + 2)] label = label + 3 del stack[-1] stack.append(expr) elif char == '?': if len(stack) == 0: raise error, 'need something to be optional' registers = registers_used(stack[-1]) if (index < len(pattern)) and (pattern[index] == '?'): # non-greedy matching expr = [FailureJump(label), Jump(label + 1), Label(label)] + \ stack[-1] + \ [Label(label + 1)] label = label + 2 index = index + 1 else: # greedy matching expr = [FailureJump(label)] + \ stack[-1] + \ [Label(label)] label = label + 1 del stack[-1] stack.append(expr) elif char == '.': if flags & DOTALL: stack.append(Set(map(chr, range(256)))) else: stack.append([AnyChar()]) elif char == '^': if flags & MULTILINE: stack.append([Bol()]) else: stack.append([BegBuf()]) elif char == '$': if flags & MULTILINE: stack.append([Eol()]) else: stack.append([EndBuf()]) elif char == '#': if flags & VERBOSE: # comment index = index + 1 end = string.find(pattern, '\n', index) if end == -1: index = len(pattern) else: index = end + 1 else: stack.append([Exact(char)]) elif char in string.whitespace: if flags & VERBOSE: stack.append([Exact(char)]) elif char == '[': if index >= len(pattern): raise error, 'incomplete set' negate = 0 last = '' set = [] if pattern[index] == '^': negate = 1 index = index + 1 if index >= len(pattern): raise error, 'incomplete set' if pattern[index] in ']-': set.append(pattern[index]) last = pattern[index] index = index + 1 while (index < len(pattern)) and (pattern[index] != ']'): next = pattern[index] index = index + 1 if next == '-': if (index >= len(pattern)) or (pattern[index] == ']'): raise error, 'incomplete range in set' if last > pattern[index]: raise error, 'range arguments out of order in set' for next in map(chr, \ range(ord(last), \ ord(pattern[index]) + 1)): if next not in set: set.append(next) last = '' index = index + 1 elif next == '\\': # expand syntax meta-characters and add to set if index >= len(pattern): raise error, 'incomplete set' elif (pattern[index] == ']'): raise error, 'backslash at the end of a set' elif pattern[index] == 'w': for next in syntax_table.keys(): if 'word' in syntax_table[next]: set.append(next) elif pattern[index] == 'W': for next in syntax_table.keys(): if 'word' not in syntax_table[next]: set.append(next) elif pattern[index] == 'd': for next in syntax_table.keys(): if 'digit' in syntax_table[next]: set.append(next) elif pattern[index] == 'D': for next in syntax_table.keys(): if 'digit' not in syntax_table[next]: set.append(next) elif pattern[index] == 's': for next in syntax_table.keys(): if 'whitespace' in syntax_table[next]: set.append(next) elif pattern[index] == 'S': for next in syntax_table.keys(): if 'whitespace' not in syntax_table[next]: set.append(next) else: raise error, 'unknown meta in set' last = '' index = index + 1 else: if next not in set: set.append(next) last = next if pattern[index] != ']': raise error, 'incomplete set' index = index + 1 if negate: notset = [] for char in map(chr, range(256)): if char not in set: notset.append(char) stack.append([Set(notset)]) else: stack.append([Set(set)]) else: stack.append([Exact(char)]) code = [] while len(stack) > 0: if stack[-1][0].name == '(': raise error, 'too many open parens' code = stack[-1] + code del stack[-1] if len(code) == 0: raise error, 'no code generated' if (code[-1].name == '|'): raise error, 'alternation with nothing on the right' code = filter(lambda x: x.name != '|', code) need_label = 0 for i in range(len(code)): if (code[i].name == 'jump') and (code[i].label == -1): code[i] = Jump(label) need_label = 1 if need_label: code.append(Label(label)) label = label + 1 code.append(End()) return RegexObject(pattern, flags, code, register, groupindex, callouts) | 65c28b7efb290f5eadf538f14514c9a48bb0f1d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/65c28b7efb290f5eadf538f14514c9a48bb0f1d7/re.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
12,
4951,
16,
2943,
33,
20,
4672,
2110,
273,
5378,
770,
273,
374,
1433,
273,
374,
1744,
273,
404,
1041,
1615,
273,
2618,
1443,
383,
12940,
273,
5378,
1323,
261,
1615,
411,
562,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
4951,
16,
2943,
33,
20,
4672,
2110,
273,
5378,
770,
273,
374,
1433,
273,
374,
1744,
273,
404,
1041,
1615,
273,
2618,
1443,
383,
12940,
273,
5378,
1323,
261,
1615,
411,
562,
1... |
trace = list(enumerate(t for i,t in trace)) | trace = list(enumerate(t for i, t in trace)) | def remake_trace(trace): trace = list(enumerate(t for i,t in trace)) tbs = make_tbs(trace) tbdict = make_tbdict(tbs) cfg = make_cfg(tbs) return trace, tbs, tbdict, cfg | 63b309d6f3838e4cb5c2921faf3bb1472f46245c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4260/63b309d6f3838e4cb5c2921faf3bb1472f46245c/newslice.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
849,
911,
67,
5129,
12,
5129,
4672,
2606,
273,
666,
12,
7924,
12600,
12,
88,
364,
277,
16,
268,
316,
2606,
3719,
268,
2038,
273,
1221,
67,
88,
2038,
12,
5129,
13,
8739,
1576,
273,
12... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
849,
911,
67,
5129,
12,
5129,
4672,
2606,
273,
666,
12,
7924,
12600,
12,
88,
364,
277,
16,
268,
316,
2606,
3719,
268,
2038,
273,
1221,
67,
88,
2038,
12,
5129,
13,
8739,
1576,
273,
12... |
[4,8,17,25,0].transpose() = [[1, -3, 0, -11, -8], * [x_0,x_1,x_2,x_3,x_4].transpose [0, 1, 0, -10, -2], | [4,8,17,25,0].transpose() = [[-1, 0, 0, -11, -8], * [x_0,x_1,x_2,x_3,x_4].transpose [0, -1, 0, -10, 0], | def GetLinearEquations(state_space_at_current_level,sigma, level): """ Output a constant vector (made up of kappa_ij 's), and a dimension*dimension matrix each row of which composes of coefficients of the unknown (which in this case is P(F|z) Input Parameters ----------------- state_space_at_current_level A list containing all the states (4-tuples) at the current level (e.g. level 5), really generated by the GetCondJumpChainState(level) method See comments in MakeTransitionMatrixForLevel for more details. level the current level Details -------- Get the necessary ingredients about the systems of equations to plug into the LinearEquationSolver The systems of equations are: for all z in Z_k, P(F|z) = sum_{w in M} P(w|z)*P(F|w(z)) + P(k_ij | z) where P(F|z) and P(F|w(z) are unknowns (could be different or same), and P(k_ij | z) and P(w|z) are knowns Now, by our CONSTRUCTION (more like assumption), ("m_1", "m_2", "s_b_arrow_t") are DISJOINT SETS in conditional probability cases, we have, after rearranging terms: P(k_ij | z) = P(F|z) - sum_{w in M} P(w|z) * P(F|w(z)) for all z in Z_k = P(F|z) - P("m_1"|z)*P(F|m_1(z)) - P("m_2"|z)*P(F|m_2(z)) - P("s_b_arrow_t"|z)*P(F|"s_b_arrow_t"(z)) There are 4(k-1) such z's, because w(z) WILL be inside M by our construction, and if it's not, we simply ignore it in our computation (b/c we would get (-1,-1,-1,-1) if it's not in the current state or an invalid state from ApplyEvent()). And when m(z) is undefined, we would treat P(w|z) as 0 So we can create a 4(k-1) by 4(k-1) matrix called A, filled with coefficients of various P(F|z)'s in each row. How do we fill out matrix A? For instance, suppose there are 5 equations of the following format x_0 = 4 + 3x_1 + 11x_3 + 8x_4 x_1 = 8 + 2x_4 + 10x_3 x_2 = 17 x_3 = 25 + 3x_1 + 12x_3 + 22x_2 x_4 = 0 + 3x_3 Rearranging, we get: 4 = x_0 - 3x_1 - 11x_3 - 8x_4 8 = x_1 - 2x_4 - 10x_3 17 = x_2 25 = x_3 - 3x_1 - 12x_0 - 22x_2 0 = x_4 - 3x_3 We want to eventually turn it into the form that: [4,8,17,25,0].transpose() = [[1, -3, 0, -11, -8], * [x_0,x_1,x_2,x_3,x_4].transpose [0, 1, 0, -10, -2], [0, 0, 1, 0, 0], [-12, -3, -22, 1, 0], [0, 0, 0, -3, 1]] We call the LHS b, and the 5x5 matrix A, we would output (A, b) Output value ------------- Return (A,b) where A is a level_number*level_number matrix, and b is a constant vector """ length = len(state_space_at_current_level) constant_vector = [UnconditionalTransitionProbability("kappa",z,sigma) for z in state_space_at_current_level] #when level_number=2, #we have state_space_at_current_level = [(2, 0, 0, 0), (1, 1, 0, 1), (0, 2, 1, 1), (1, 1, 1, 0)] #and constant_vector = [1.0, 0.00049975012493753122, 0.058823846204939162, 0.00049975012493753122] #First create a level by level matrix with diagonal #initialized to 1's and rest 0's Fill in the diagonals with 1's #We really want the coefficients to be ints. matrix = eye(length,length, dtype=float) #Fill in the coefficient P("m_1"|z) into cell matrix[index of z][index of w(z)] #First, create a Probability of w given Z vector prob_m1_vector = [-UnconditionalTransitionProbability("m_1", z, sigma) for z in state_space_at_current_level] prob_m2_vector = [-UnconditionalTransitionProbability("m_2", z, sigma) for z in state_space_at_current_level] prob_s_b_arrow_t_vector = [-UnconditionalTransitionProbability("smaller_s_b_arrow_t", z, sigma) for z in state_space_at_current_level] #print "prob_m1_vector is: " + str(prob_m1_vector) #print "prob_m2_vector is: " + str(prob_m2_vector) #print "prob_s_b_arrow_t_vector is: " + str(prob_s_b_arrow_t_vector) #For instance, when level=2, prob_s_b_arrow_t is #[0.0, 0.99950024987506236, 0.94117615379506092, 0.99950024987506236] #Remember prob_w_given_z_vector does not depend on (x_1,x_2) #This way, prob_w_given_z[3] refers to the probability of #w_given_z_vector for the third element in state_space_at_current_level, #or really state_space_at_current_level[2] m1_vector = [ApplyEvent(z,"m_1",level) for z in state_space_at_current_level] m2_vector = [ApplyEvent(z,"m_2",level) for z in state_space_at_current_level] s_b_arrow_t_vector = [ApplyEvent(z,"smaller_s_b_arrow_t",level) for z in state_space_at_current_level] #print m1_vector #print m2_vector #print s_b_arrow_t_vector #For instance, the following code #state_space_at_current_level = GetCondJumpChainStateSpace(2) #print state_space_at_current_level #s_b_arrow_t_vector = [ApplyEvent(z,"s_b_arrow_t") for z in state_space_at_current_level] #generates: #state_space_at_current_level = [(2, 0, 0, 0), (1, 1, 0, 1), (0, 2, 1, 1), (1, 1, 1, 0)] #s_b_arrow_t_vector = [(-1, -1, -1, -1), (2, 0, 0, 1), (1, 1, -1, -1), (2, 0, 1, 0)] #So s_b_arrow_t_vector is an "ordered" list of the w(z)'s. level_number = length/4 + 1 state_to_index_map = MakeState2IndexDictionary(level_number) #print "state_to_index_map[(1,2,0,1)] is: " + str(state_to_index_map[x]) assert(length == len(state_space_at_current_level) == len(prob_m1_vector) == len(m1_vector)) for row in range(length): #for each row in the matrix, only fill in 3 numbers #So this implementation is faster than going through the #entire matrix if (m1_vector[row]!=(-1,-1,-1,-1)): #Otherwise, keep it 0 index_of_m1 = state_to_index_map[m1_vector[row]] matrix[row,index_of_m1] = prob_m1_vector[row] if (m2_vector[row]!=(-1,-1,-1,-1)): #Otherwise, keep it 0 index_of_m2 = state_to_index_map[m2_vector[row]] matrix[row,index_of_m2] = prob_m2_vector[row] if (s_b_arrow_t_vector[row]!=(-1,-1,-1,-1)): #Otherwise, keep it 0 index_of_s_b_arrow_t = state_to_index_map[s_b_arrow_t_vector[row]] matrix[row,index_of_s_b_arrow_t] = prob_s_b_arrow_t_vector[row] return (matrix, constant_vector) | 7faf202b1836f91fc50c86fe3b92f5a5d79dc08b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7945/7faf202b1836f91fc50c86fe3b92f5a5d79dc08b/cjumpchain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
15982,
13142,
1012,
12,
2019,
67,
2981,
67,
270,
67,
2972,
67,
2815,
16,
13201,
16,
1801,
4672,
3536,
3633,
279,
5381,
3806,
261,
81,
2486,
731,
434,
23125,
67,
8302,
296,
87,
363... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
968,
15982,
13142,
1012,
12,
2019,
67,
2981,
67,
270,
67,
2972,
67,
2815,
16,
13201,
16,
1801,
4672,
3536,
3633,
279,
5381,
3806,
261,
81,
2486,
731,
434,
23125,
67,
8302,
296,
87,
363... |
self.build_action_dag(job_run) | self.build_action_dag(job_run, actions) | def build_run(self, node=None): job_run = JobRun(self) job_run.node = node or self.node_pool.next() | c24c6174f0d18dcac30704bbe2b220956db34191 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14977/c24c6174f0d18dcac30704bbe2b220956db34191/job.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2681,
12,
2890,
16,
756,
33,
7036,
4672,
1719,
67,
2681,
273,
3956,
1997,
12,
2890,
13,
1719,
67,
2681,
18,
2159,
273,
756,
578,
365,
18,
2159,
67,
6011,
18,
4285,
1435,
2,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2681,
12,
2890,
16,
756,
33,
7036,
4672,
1719,
67,
2681,
273,
3956,
1997,
12,
2890,
13,
1719,
67,
2681,
18,
2159,
273,
756,
578,
365,
18,
2159,
67,
6011,
18,
4285,
1435,
2,... |
c.fs.rebind(c.fs.model, data=request.params) | c.fs = c.fs.bind(data=request.params) | def edit(self, modelname, id=None): fs = self._model_fieldsets[modelname] S = self._session if id: instance = S.query(fs.model.__class__).get(id) c.fs = fs.bind(instance) else: c.fs = fs.bind(fs.model.__class__) S.save(c.fs.model) if request.method == 'POST': c.fs.rebind(c.fs.model, data=request.params) log.debug('saving %s w/ %s' % (c.fs.model.id, request.POST)) if c.fs.validate(): c.fs.sync() S.commit() S.refresh(c.fs.model) flash('%s %s %s' % (id == None and 'Created' or 'Modified', modelname, _pk(c.fs.model))) redirect_to(url_for(action='list')) return edit_template.render(c=c, h=h) | 57d929b6c07eaa54b6fed5c824506cbde1cc3d62 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13203/57d929b6c07eaa54b6fed5c824506cbde1cc3d62/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
12,
2890,
16,
938,
529,
16,
612,
33,
7036,
4672,
2662,
273,
365,
6315,
2284,
67,
1518,
4424,
63,
2284,
529,
65,
348,
273,
365,
6315,
3184,
309,
612,
30,
791,
273,
348,
18,
2271... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
12,
2890,
16,
938,
529,
16,
612,
33,
7036,
4672,
2662,
273,
365,
6315,
2284,
67,
1518,
4424,
63,
2284,
529,
65,
348,
273,
365,
6315,
3184,
309,
612,
30,
791,
273,
348,
18,
2271... |
def compile_dir(dir, maxlevels=10, ddir=None, force=0, rx=None): | def compile_dir(dir, maxlevels=10, ddir=None, force=0, rx=None, quiet=0): | def compile_dir(dir, maxlevels=10, ddir=None, force=0, rx=None): """Byte-compile all modules in the given directory tree. Arguments (only dir is required): dir: the directory to byte-compile maxlevels: maximum recursion level (default 10) ddir: if given, purported directory name (this is the directory name that will show up in error messages) force: if 1, force compilation, even if timestamps are up-to-date """ print 'Listing', dir, '...' try: names = os.listdir(dir) except os.error: print "Can't list", dir names = [] names.sort() success = 1 for name in names: fullname = os.path.join(dir, name) if ddir: dfile = os.path.join(ddir, name) else: dfile = None if rx: mo = rx.search(fullname) if mo: continue if os.path.isfile(fullname): head, tail = name[:-3], name[-3:] if tail == '.py': cfile = fullname + (__debug__ and 'c' or 'o') ftime = os.stat(fullname)[stat.ST_MTIME] try: ctime = os.stat(cfile)[stat.ST_MTIME] except os.error: ctime = 0 if (ctime > ftime) and not force: continue print 'Compiling', fullname, '...' try: ok = py_compile.compile(fullname, None, dfile) except KeyboardInterrupt: raise KeyboardInterrupt except: # XXX py_compile catches SyntaxErrors if type(sys.exc_type) == type(''): exc_type_name = sys.exc_type else: exc_type_name = sys.exc_type.__name__ print 'Sorry:', exc_type_name + ':', print sys.exc_value success = 0 else: if ok == 0: success = 0 elif maxlevels > 0 and \ name != os.curdir and name != os.pardir and \ os.path.isdir(fullname) and \ not os.path.islink(fullname): if not compile_dir(fullname, maxlevels - 1, dfile, force, rx): success = 0 return success | 0f9b0fd3c2a89f138e2ebe25a20280803a090026 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/0f9b0fd3c2a89f138e2ebe25a20280803a090026/compileall.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
67,
1214,
12,
1214,
16,
943,
12095,
33,
2163,
16,
302,
1214,
33,
7036,
16,
2944,
33,
20,
16,
8581,
33,
7036,
16,
10902,
33,
20,
4672,
3536,
3216,
17,
11100,
777,
4381,
316,
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,
4074,
67,
1214,
12,
1214,
16,
943,
12095,
33,
2163,
16,
302,
1214,
33,
7036,
16,
2944,
33,
20,
16,
8581,
33,
7036,
16,
10902,
33,
20,
4672,
3536,
3216,
17,
11100,
777,
4381,
316,
326... |
expected = 'In 3.x, hex() converts the result of __index__ to hexidecimal.' | expected = 'In 3.x, hex() converts the result of __index__ to hexadecimal.' | def __oct__(self): return "07" | d5ba5fbd50df9d0e8afc19ff1ca0f0f272c8053d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/d5ba5fbd50df9d0e8afc19ff1ca0f0f272c8053d/test_py3kwarn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
13410,
972,
12,
2890,
4672,
327,
315,
8642,
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,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
13410,
972,
12,
2890,
4672,
327,
315,
8642,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.body.append(graph.to_latex(self._directory) | self.body.append(graph.to_latex(self._directory)) | def visit_dotgraph(self, node): if self._directory is None: raise SkipNode() # [xx] warning? # Generate the graph. graph = node.graph(self._docindex, self._context, self._linker) if graph is None: raise SkipNode() # Write the graph. self.body.append(graph.to_latex(self._directory) raise SkipNode() | e922205159088d5f9025bbb0e8ea54a9876db034 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11420/e922205159088d5f9025bbb0e8ea54a9876db034/restructuredtext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
9811,
4660,
12,
2890,
16,
756,
4672,
309,
365,
6315,
5149,
353,
599,
30,
1002,
6611,
907,
1435,
468,
306,
5279,
65,
3436,
35,
225,
468,
6654,
326,
2667,
18,
2667,
273,
756,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
9811,
4660,
12,
2890,
16,
756,
4672,
309,
365,
6315,
5149,
353,
599,
30,
1002,
6611,
907,
1435,
468,
306,
5279,
65,
3436,
35,
225,
468,
6654,
326,
2667,
18,
2667,
273,
756,
... |
self.modified = 0 self.nocalc = 0 | self.modified = False self.nocalc = False | def loadFromXML(self, template): self.initialize(1) self.OutfitName.clear() racename = '' classname = '' self.outfitlist = [] self.outfitnumbering = 1 self.currentOutfit = 0 self.itemnumbering = 1 itemdefault = self.itemattrlist.copy() for child in template.childNodes: if child.nodeType == Node.TEXT_NODE: continue if child.tagName == 'Name': self.CharName.setText(XMLHelper.getText(child.childNodes)) elif child.tagName == 'Class': self.charclass = XMLHelper.getText(child.childNodes) elif child.tagName == 'Race': racename = XMLHelper.getText(child.childNodes) elif child.tagName == 'Realm': self.realm = XMLHelper.getText(child.childNodes) elif child.tagName == 'Level': self.CharLevel.setText(XMLHelper.getText(child.childNodes)) elif child.tagName == 'Notes': self.noteText = XMLHelper.getText(child.childNodes) elif child.tagName == 'SCItem': newItem = Item(realm=self.realm) newItem.loadFromXML(child,str(self.itemnumbering)) if newItem.TemplateIndex == -1: newItem.TemplateIndex = self.itemIndex self.itemIndex += 1 else: self.itemIndex = max(newItem.TemplateIndex + 1, self.itemIndex) if newItem.next: if newItem.next.TemplateIndex == -1: newItem.next.TemplateIndex = self.itemIndex self.itemIndex += 1 else: self.itemIndex = max(newItem.next.TemplateIndex + 1, self.itemIndex) | cdc9cf773cf0c254cf668f14ba48aa9d538724e6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6671/cdc9cf773cf0c254cf668f14ba48aa9d538724e6/ScWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24935,
4201,
12,
2890,
16,
1542,
4672,
365,
18,
11160,
12,
21,
13,
365,
18,
1182,
7216,
461,
18,
8507,
1435,
767,
71,
1069,
273,
875,
7479,
273,
875,
365,
18,
659,
7216,
1098,
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,
24935,
4201,
12,
2890,
16,
1542,
4672,
365,
18,
11160,
12,
21,
13,
365,
18,
1182,
7216,
461,
18,
8507,
1435,
767,
71,
1069,
273,
875,
7479,
273,
875,
365,
18,
659,
7216,
1098,
273,
5... |
control = can_do_verif_ypin(hCard) | control = can_do_verify_ypin(hCard) | def verifypin(hCard, control=None): if None==control: control = can_do_verif_ypin(hCard) if (None == control): raise error, "Not a pinpad" hresult, response = SCardControl(hcard, control, []) if hresult!=SCARD_S_SUCCESS: raise error, 'SCardControl failed: ' + SCardGetErrorMessage(hresult) return hresult, response | 425a45146d2eab532a962be88c683facd8aa2b3f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3537/425a45146d2eab532a962be88c683facd8aa2b3f/sample_pinpad.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1924,
430,
879,
267,
12,
76,
6415,
16,
3325,
33,
7036,
4672,
309,
599,
631,
7098,
30,
3325,
273,
848,
67,
2896,
67,
8705,
67,
879,
267,
12,
76,
6415,
13,
309,
261,
7036,
422,
3325,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1924,
430,
879,
267,
12,
76,
6415,
16,
3325,
33,
7036,
4672,
309,
599,
631,
7098,
30,
3325,
273,
848,
67,
2896,
67,
8705,
67,
879,
267,
12,
76,
6415,
13,
309,
261,
7036,
422,
3325,
... |
pat = sre.compile('a(?:b|(c|e){1,2}?|d)+?(.)') | pat = sre.compile(r'a(?:b|(c|e){1,2}?|d)+?(.)') | def bump_num(matchobj): int_value = int(matchobj.group(0)) return str(int_value + 1) | 0a2834dcd5225e58ecbabd8284a9268fcf954294 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/0a2834dcd5225e58ecbabd8284a9268fcf954294/test_sre.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23559,
67,
2107,
12,
1916,
2603,
4672,
509,
67,
1132,
273,
509,
12,
1916,
2603,
18,
1655,
12,
20,
3719,
327,
609,
12,
474,
67,
1132,
397,
404,
13,
225,
2,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
23559,
67,
2107,
12,
1916,
2603,
4672,
509,
67,
1132,
273,
509,
12,
1916,
2603,
18,
1655,
12,
20,
3719,
327,
609,
12,
474,
67,
1132,
397,
404,
13,
225,
2,
-100,
-100,
-100,
-100,
-10... |
glColor3f(0.4,0.4,0) | glColor3f(1,1,0) | def draw(self): from visualizer import * glBegin(GL_LINES) glColor3f(0.4,0.4,0) for p in self.trace: glVertex2f(p.x,p.y) glEnd() | 7e4ade451b85e4cd3cc83c6ea54b9246b0fcafd7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5773/7e4ade451b85e4cd3cc83c6ea54b9246b0fcafd7/rail_controller.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
628,
11623,
1824,
1930,
380,
5118,
8149,
12,
11261,
67,
5997,
55,
13,
5118,
2957,
23,
74,
12,
21,
16,
21,
16,
20,
13,
364,
293,
316,
365,
18,
5129,
30,
5118,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
12,
2890,
4672,
628,
11623,
1824,
1930,
380,
5118,
8149,
12,
11261,
67,
5997,
55,
13,
5118,
2957,
23,
74,
12,
21,
16,
21,
16,
20,
13,
364,
293,
316,
365,
18,
5129,
30,
5118,
... |
event.Skip() | def _handlerModulesListBoxMouseEvents(self, event): if not event.Dragging(): # if no dragging is taking place, let somebody else # handle this event... event.Skip() return mlb = self._modulePaletteFrame.modulesListBox | 59eda2a59f19c6b32388b4fe2e620352a7076628 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/59eda2a59f19c6b32388b4fe2e620352a7076628/graphEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4176,
7782,
682,
3514,
9186,
3783,
12,
2890,
16,
871,
4672,
309,
486,
871,
18,
11728,
1998,
13332,
468,
309,
1158,
25434,
353,
13763,
3166,
16,
2231,
2690,
3432,
469,
468,
1640,
333... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4176,
7782,
682,
3514,
9186,
3783,
12,
2890,
16,
871,
4672,
309,
486,
871,
18,
11728,
1998,
13332,
468,
309,
1158,
25434,
353,
13763,
3166,
16,
2231,
2690,
3432,
469,
468,
1640,
333... | |
elif ext == '.yaml': | elif ext == '.yml': | def load_module_graph(cr, graph, status=None, perform_checks=True, **kwargs): # **kwargs is passed directly to convert_xml_import if not status: status = {} status = status.copy() package_todo = [] statusi = 0 pool = pooler.get_pool(cr.dbname) migrations = MigrationManager(cr, graph) has_updates = False modobj = None logger.notifyChannel('init', netsvc.LOG_DEBUG, 'loading %d packages..' % len(graph)) for package in graph: logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading objects' % package.name) migrations.migrate_module(package, 'pre') register_class(package.name) modules = pool.instanciate(package.name, cr) if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): init_module_objects(cr, package.name, modules) cr.commit() for package in graph: status['progress'] = (float(statusi)+0.1) / len(graph) m = package.name mid = package.id if modobj is None: modobj = pool.get('ir.module.module') if modobj and perform_checks: modobj.check(cr, 1, [mid]) idref = {} status['progress'] = (float(statusi)+0.4) / len(graph) mode = 'update' if hasattr(package, 'init') or package.state == 'to install': mode = 'init' if hasattr(package, 'init') or hasattr(package, 'update') or package.state in ('to install', 'to upgrade'): has_updates = True for kind in ('init', 'update'): if package.state=='to upgrade': # upgrading the module information modobj.write(cr, 1, [mid], { 'description': package.data.get('description', ''), 'shortdesc': package.data.get('name', ''), 'author': package.data.get('author', 'Unknown'), 'website': package.data.get('website', ''), 'license': package.data.get('license', 'GPL-2'), 'certificate': package.data.get('certificate') or None, }) for filename in package.data.get('%s_xml' % kind, []): logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, filename)) name, ext = os.path.splitext(filename) fp = tools.file_open(opj(m, filename)) if ext == '.csv': noupdate=False if kind == 'init': noupdate=True tools.convert_csv_import(cr, m, os.path.basename(filename), fp.read(), idref, mode=mode, noupdate=noupdate) elif ext == '.sql': queries = fp.read().split(';') for query in queries: new_query = ' '.join(query.split()) if new_query: cr.execute(new_query) elif ext == '.yaml': tools.convert_yaml_import(cr, m, fp, idref, mode=mode, **kwargs) else: tools.convert_xml_import(cr, m, fp, idref, mode=mode, **kwargs) fp.close() if hasattr(package, 'demo') or (package.dbdemo and package.state != 'installed'): status['progress'] = (float(statusi)+0.75) / len(graph) for xml in package.data.get('demo_xml', []): name, ext = os.path.splitext(xml) logger.notifyChannel('init', netsvc.LOG_INFO, 'module %s: loading %s' % (m, xml)) fp = tools.file_open(opj(m, xml)) if ext == '.csv': tools.convert_csv_import(cr, m, os.path.basename(xml), fp.read(), idref, mode=mode, noupdate=True) else: tools.convert_xml_import(cr, m, fp, idref, mode=mode, noupdate=True, **kwargs) fp.close() cr.execute('update ir_module_module set demo=%s where id=%s', (True, mid)) package_todo.append(package.name) migrations.migrate_module(package, 'post') if modobj: ver = release.major_version + '.' + package.data.get('version', '1.0') # Set new modules and dependencies modobj.write(cr, 1, [mid], {'state': 'installed', 'latest_version': ver}) cr.commit() # Update translations for all installed languages modobj.update_translations(cr, 1, [mid], None) cr.commit() package.state = 'installed' for kind in ('init', 'demo', 'update'): if hasattr(package, kind): delattr(package, kind) statusi += 1 cr.execute('select model from ir_model where state=%s', ('manual',)) for model in cr.dictfetchall(): pool.get('ir.model').instanciate(cr, 1, model['model'], {}) pool.get('ir.model.data')._process_end(cr, 1, package_todo) cr.commit() return has_updates | 53c50946a894d70b3047d4cce80142702f41787b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/53c50946a894d70b3047d4cce80142702f41787b/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2978,
67,
4660,
12,
3353,
16,
2667,
16,
1267,
33,
7036,
16,
3073,
67,
12366,
33,
5510,
16,
2826,
4333,
4672,
468,
2826,
4333,
353,
2275,
5122,
358,
1765,
67,
2902,
67,
5666,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2978,
67,
4660,
12,
3353,
16,
2667,
16,
1267,
33,
7036,
16,
3073,
67,
12366,
33,
5510,
16,
2826,
4333,
4672,
468,
2826,
4333,
353,
2275,
5122,
358,
1765,
67,
2902,
67,
5666,
... |
log.error("new file %s conflicts with file on head of branch" % realPath) | self.errors.append("new file %s conflicts with file on " + "head of branch" % realPath) | def _singlePackage(self, repos, pkgCs, changeSet, basePkg, fsPkg, root): | 9e9969f45daafddcbb99e4e9dc5b3d6042825259 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8747/9e9969f45daafddcbb99e4e9dc5b3d6042825259/update.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7526,
2261,
12,
2890,
16,
13686,
16,
3475,
14272,
16,
26104,
16,
1026,
11264,
16,
2662,
11264,
16,
1365,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7526,
2261,
12,
2890,
16,
13686,
16,
3475,
14272,
16,
26104,
16,
1026,
11264,
16,
2662,
11264,
16,
1365,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
[Local data at Fractional ideal (-3*i - 2): | [Local data at Fractional ideal (2*i + 1): Reduction type: bad non-split multiplicative Local minimal model: Elliptic Curve defined by y^2 + (i+1)*x*y + y = x^3 over Number Field in i with defining polynomial x^2 + 1 Minimal discriminant valuation: 1 Conductor exponent: 1 Kodaira Symbol: I1 Tamagawa Number: 1, Local data at Fractional ideal (-3*i - 2): | def local_data(self, P=None, proof = None): r""" Local data for this elliptic curve at the prime `P`. | cf244127e9bb9f967ada740d4a81d0e96d5dcab8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/cf244127e9bb9f967ada740d4a81d0e96d5dcab8/ell_number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
67,
892,
12,
2890,
16,
453,
33,
7036,
16,
14601,
273,
599,
4672,
436,
8395,
3566,
501,
364,
333,
415,
549,
21507,
8882,
622,
326,
17014,
1375,
52,
8338,
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,
1191,
67,
892,
12,
2890,
16,
453,
33,
7036,
16,
14601,
273,
599,
4672,
436,
8395,
3566,
501,
364,
333,
415,
549,
21507,
8882,
622,
326,
17014,
1375,
52,
8338,
2,
-100,
-100,
-100,
-100... |
- resp: server response if succesful | - resp: server response if successful | def group(self, name): """Process a GROUP command. Argument: - group: the group name Returns: - resp: server response if succesful - count: number of articles (string) - first: first article number (string) - last: last article number (string) - name: the group name""" | 2b9ab6deeb822299ae8e193ffb4fa9d7bd4be97e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/2b9ab6deeb822299ae8e193ffb4fa9d7bd4be97e/nntplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1041,
12,
2890,
16,
508,
4672,
3536,
2227,
279,
13839,
1296,
18,
225,
5067,
30,
300,
1041,
30,
326,
1041,
508,
2860,
30,
300,
1718,
30,
1438,
766,
309,
6873,
300,
1056,
30,
1300,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1041,
12,
2890,
16,
508,
4672,
3536,
2227,
279,
13839,
1296,
18,
225,
5067,
30,
300,
1041,
30,
326,
1041,
508,
2860,
30,
300,
1718,
30,
1438,
766,
309,
6873,
300,
1056,
30,
1300,
434,
... |
""" | ''' | def testSkinResource(self): self.assertEqual( queryResource('test', request, None), None) | 1cfc7ddd1cac0110cca3e909215477e1c59bbca3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9523/1cfc7ddd1cac0110cca3e909215477e1c59bbca3/test_directives.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
26827,
1420,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
843,
1420,
2668,
3813,
2187,
590,
16,
599,
3631,
599,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
26827,
1420,
12,
2890,
4672,
365,
18,
11231,
5812,
12,
843,
1420,
2668,
3813,
2187,
590,
16,
599,
3631,
599,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
'flushing') | 'flushing', 'showingStill') | def push(self, value): """Push back 'value' into the iterator""" self.pushedBack.append(value) | 8f9c212b3a2e0be3006d8042e7c380d06ae645ac /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5222/8f9c212b3a2e0be3006d8042e7c380d06ae645ac/manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1817,
12,
2890,
16,
460,
4672,
3536,
7621,
1473,
296,
1132,
11,
1368,
326,
2775,
8395,
365,
18,
6206,
329,
2711,
18,
6923,
12,
1132,
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,
0,
0,
0,
0,
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,
1817,
12,
2890,
16,
460,
4672,
3536,
7621,
1473,
296,
1132,
11,
1368,
326,
2775,
8395,
365,
18,
6206,
329,
2711,
18,
6923,
12,
1132,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print obj, dir(obj) | def _checkId(self, id, allow_dup=0): # If allow_dup is false, an error will be raised if an object # with the given id already exists. If allow_dup is true, # only check that the id string contains no illegal chars; # _checkId() will be called again later with allow_dup # set to false before the object is added. if not id or (type(id) != type('')): raise 'Bad Request', 'Empty or invalid id specified.' if bad_id(id) != -1: raise 'Bad Request', ( 'The id "%s" contains characters illegal in URLs.' % id) if id[0]=='_': raise 'Bad Request', ( 'The id "%s" is invalid - it begins with an underscore.' % id) if not allow_dup: obj = getattr(self, id, None) if obj is not None: # An object by the given id exists either in this # ObjectManager or in the acquisition path. print obj, dir(obj) flag = getattr(obj, '__replaceable__', NOT_REPLACEABLE) if flag == UNIQUE: raise 'Bad Request', \ ('The id "%s" is reserved by another object.' % id) base = getattr(self, 'aq_base', self) if hasattr(base, id): # The object is located in this ObjectManager. if flag != REPLACEABLE: raise 'Bad Request', ('The id "%s" is invalid - ' \ 'it is already in use.' % id) if id == 'REQUEST': raise 'Bad Request', 'REQUEST is a reserved name.' if '/' in id: raise 'Bad Request', ( 'The id "%s" contains characters illegal in URLs.' % id ) | 855c12810245c7d85a54d4e71fc969a41f147972 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/855c12810245c7d85a54d4e71fc969a41f147972/ObjectManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1893,
548,
12,
2890,
16,
612,
16,
1699,
67,
26427,
33,
20,
4672,
468,
971,
1699,
67,
26427,
353,
629,
16,
392,
555,
903,
506,
11531,
309,
392,
733,
468,
598,
326,
864,
612,
1818... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1893,
548,
12,
2890,
16,
612,
16,
1699,
67,
26427,
33,
20,
4672,
468,
971,
1699,
67,
26427,
353,
629,
16,
392,
555,
903,
506,
11531,
309,
392,
733,
468,
598,
326,
864,
612,
1818... | |
sage: g.coeffs() | sage: g.coefficients() | def polynomial(self, base_ring): r""" Return \code{self} as an algebraic polynomial over the given base ring, if possible. | 2e32b7247af3731db881ec5bd651880a8fc8c790 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/2e32b7247af3731db881ec5bd651880a8fc8c790/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16991,
12,
2890,
16,
1026,
67,
8022,
4672,
436,
8395,
2000,
521,
710,
95,
2890,
97,
487,
392,
524,
29087,
335,
16991,
1879,
326,
864,
1026,
9221,
16,
309,
3323,
18,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16991,
12,
2890,
16,
1026,
67,
8022,
4672,
436,
8395,
2000,
521,
710,
95,
2890,
97,
487,
392,
524,
29087,
335,
16991,
1879,
326,
864,
1026,
9221,
16,
309,
3323,
18,
2,
-100,
-100,
-100... |
data = StripLineSep(string.lstrip(data)) | data = StripLineSep(data[1:]) | def ParseLDIF(f,ignore_attrs=[],maxentries=0): """ Parse LDIF data read from file object f f file-object for reading LDIF input ignore_attrs list of attributes to be ignored maxentries if non-zero specifies the maximum number of entries to be read from f """ result = [] # lower-case all ignore_attrs = map(string.lower,ignore_attrs) # Read very first line s = f.readline() entries_read = 0 while s and (not maxentries or entries_read<maxentries): # Reading new entry # Reset entry data dn = None; entry = {}; while s: # Reading new attribute line attr,data=string.split(s,':',1) if data[0]==':': # Read attr:: data line => binary data assumed data = data[1:] binary = 1 elif data[0]=='<' or data[:1]==' <': raise ValueError,'File importing not supported' else: # Read attr: data line binary = 0 # Strip the line separators data = StripLineSep(string.lstrip(data)) s = f.readline() # Reading continued multi-line data while s and s[0]==' ': data = data + string.strip(s) # Read next line s = f.readline() attr = string.strip(attr) if not string.lower(attr) in ignore_attrs: if binary: # binary data has to be BASE64 decoded data = base64.decodestring(data) # Add attr: data to entry if attr=='dn': dn = string.strip(data) ; attr = '' ; data = '' if not is_dn(dn): raise ValueError, 'No valid string-representation of distinguished name.' else: if entry.has_key(attr): entry[attr].append(data) else: entry[attr]=[data] # end of entry reached marked by newline character(s) if entry: # append entry to result list result.append((dn,entry)) entries_read = entries_read+1 # Start reading next entry s = f.readline() return result | 21bfd496471feb52fb1512e489fd0ce44f7d6e67 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4610/21bfd496471feb52fb1512e489fd0ce44f7d6e67/ldif.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
48,
2565,
42,
12,
74,
16,
6185,
67,
7039,
22850,
6487,
1896,
8219,
33,
20,
4672,
3536,
2884,
511,
2565,
42,
501,
855,
628,
585,
733,
284,
225,
284,
585,
17,
1612,
364,
6453,
51... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
48,
2565,
42,
12,
74,
16,
6185,
67,
7039,
22850,
6487,
1896,
8219,
33,
20,
4672,
3536,
2884,
511,
2565,
42,
501,
855,
628,
585,
733,
284,
225,
284,
585,
17,
1612,
364,
6453,
51... |
def run_parallel(dbdir, cells, querydir, querysift, outputFilePaths, params, num_threads=4): | def run_parallel(dbdir, cells, querydir, querysift, outputFilePaths, params, num_threads=8): | def run_parallel(dbdir, cells, querydir, querysift, outputFilePaths, params, num_threads=4): semaphore = threading.Semaphore(num_threads) threads = [] for cell, outputFilePath in zip(cells, outputFilePaths): if not os.path.exists(outputFilePath): thread = Query(dbdir, cell, querydir, querysift, outputFilePath, params, semaphore) threads.append(thread) thread.start() for thread in threads: thread.join() | 6ecc92bdac1abbbc888f8f80ee69dae1eb00f4b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10532/6ecc92bdac1abbbc888f8f80ee69dae1eb00f4b7/query.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
18054,
12,
1966,
1214,
16,
5983,
16,
843,
1214,
16,
843,
87,
2136,
16,
15047,
4466,
16,
859,
16,
818,
67,
12495,
33,
28,
4672,
28921,
273,
17254,
18,
13185,
18837,
12,
2107,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
67,
18054,
12,
1966,
1214,
16,
5983,
16,
843,
1214,
16,
843,
87,
2136,
16,
15047,
4466,
16,
859,
16,
818,
67,
12495,
33,
28,
4672,
28921,
273,
17254,
18,
13185,
18837,
12,
2107,
... |
self.wants_agg_std_dev, self.objects_choice] | self.wants_agg_std_dev, self.wants_agg_mean_well, self.wants_agg_median_well, self.wants_agg_std_dev_well, self.objects_choice] | def visible_settings(self): needs_default_output_directory =\ (self.db_type != DB_MYSQL or self.store_csvs.value or self.save_cpa_properties.value) result = [self.db_type] if self.db_type==DB_MYSQL: if HAS_MYSQL_DB: result += [self.store_csvs] else: result += [self.mysql_not_available] if self.store_csvs.value or not HAS_MYSQL_DB: result += [self.sql_file_prefix] result += [self.db_name] else: result += [self.db_name] result += [self.db_host] result += [self.db_user] result += [self.db_passwd] elif self.db_type==DB_SQLITE: result += [self.sqlite_file] elif self.db_type==DB_ORACLE: result += [self.sql_file_prefix] result += [self.want_table_prefix] if self.want_table_prefix.value: result += [self.table_prefix] result += [self.save_cpa_properties] if needs_default_output_directory: result += [self.use_default_output_directory] if not self.use_default_output_directory.value: result += [self.output_directory] result += [self.wants_agg_mean, self.wants_agg_median, self.wants_agg_std_dev, self.objects_choice] if self.objects_choice == O_SELECT: result += [self.objects_list] return result | d6b5f5226b5e4529a78162bf31dbd49fc7b89523 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2870/d6b5f5226b5e4529a78162bf31dbd49fc7b89523/exporttodatabase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6021,
67,
4272,
12,
2890,
4672,
4260,
67,
1886,
67,
2844,
67,
5149,
273,
64,
261,
2890,
18,
1966,
67,
723,
480,
2383,
67,
22114,
3997,
578,
365,
18,
2233,
67,
6715,
87,
18,
1132,
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,
6021,
67,
4272,
12,
2890,
4672,
4260,
67,
1886,
67,
2844,
67,
5149,
273,
64,
261,
2890,
18,
1966,
67,
723,
480,
2383,
67,
22114,
3997,
578,
365,
18,
2233,
67,
6715,
87,
18,
1132,
578... |
IM_lines = [unicode(line) for line in IM_lines] | IM_lines = [unicode(line, cur_encoding) for line in IM_lines] | def ConfigAvailFonts(self): """Determine fonts that are available in both wx.Python and ImageMagick.""" # Find the shared fonts between ImageMagick and wx.Python ########################################################### # IM and wx store their available fonts differently, so we need a # dictionary that maps the wx name for a font to its IM name. For # example: "Bitstream Vera Sans Mono" in wx maps to # "Bitstream-Vera-Sans-Mono" in IM. Fortunately, the difference # between font names are only non-word characters. So by abbreviating # the names of each font, common fonts can be found in the # intersection of the two sets of abbreviated names. If the # abbreviated names are keys in a dictionary that map the abbreviated # name to the original name, then the shared keys between the IM and # wx dictionaries can be used to build the final wx <--> IM dictionary. # phew! | 679ba71ea6911c34c77dffe6e6cff17d79e61edf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4675/679ba71ea6911c34c77dffe6e6cff17d79e61edf/configs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1903,
3769,
671,
5711,
87,
12,
2890,
4672,
3536,
8519,
16450,
716,
854,
2319,
316,
3937,
7075,
18,
15774,
471,
3421,
11372,
1200,
12123,
468,
4163,
326,
5116,
16450,
3086,
3421,
11372,
120... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1903,
3769,
671,
5711,
87,
12,
2890,
4672,
3536,
8519,
16450,
716,
854,
2319,
316,
3937,
7075,
18,
15774,
471,
3421,
11372,
1200,
12123,
468,
4163,
326,
5116,
16450,
3086,
3421,
11372,
120... |
if not closeScope(scopes, ' printScopeError(' | if not closeScope(scopes, ' printScopeError(' | #enddef - closes a scope | 0102da6ad83060d3ae0feccfa3d8643ce7252178 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9355/0102da6ad83060d3ae0feccfa3d8643ce7252178/wmliterator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
409,
536,
300,
13445,
279,
2146,
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,
468,
409,
536,
300,
13445,
279,
2146,
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,
-10... |
We can also create spaces corresponding to the groups `\GammaH(N)` intermediate | We can also create spaces corresponding to the groups `\Gamma_H(N)` intermediate | def ModularForms(group = 1, weight = 2, base_ring = None, use_cache = True, prec = defaults.DEFAULT_PRECISION): r""" Create an ambient space of modular forms. INPUT: - ``group`` - A congruence subgroup or a Dirichlet character eps. - ``weight`` - int, the weight, which must be an integer = 1. - ``base_ring`` - the base ring (ignored if group is a Dirichlet character) Create using the command ModularForms(group, weight, base_ring) where group could be either a congruence subgroup or a Dirichlet character. EXAMPLES: First we create some spaces with trivial character:: sage: ModularForms(Gamma0(11),2).dimension() 2 sage: ModularForms(Gamma0(1),12).dimension() 2 If we give an integer N for the congruence subgroup, it defaults to `\Gamma_0(N)`:: sage: ModularForms(1,12).dimension() 2 sage: ModularForms(11,4) Modular Forms space of dimension 4 for Congruence Subgroup Gamma0(11) of weight 4 over Rational Field We create some spaces for `\Gamma_1(N)`. :: sage: ModularForms(Gamma1(13),2) Modular Forms space of dimension 13 for Congruence Subgroup Gamma1(13) of weight 2 over Rational Field sage: ModularForms(Gamma1(13),2).dimension() 13 sage: [ModularForms(Gamma1(7),k).dimension() for k in [2,3,4,5]] [5, 7, 9, 11] sage: ModularForms(Gamma1(5),11).dimension() 12 We create a space with character:: sage: e = (DirichletGroup(13).0)^2 sage: e.order() 6 sage: M = ModularForms(e, 2); M Modular Forms space of dimension 3, character [zeta6] and weight 2 over Cyclotomic Field of order 6 and degree 2 sage: f = M.T(2).charpoly('x'); f x^3 + (-2*zeta6 - 2)*x^2 - 2*zeta6*x + 14*zeta6 - 7 sage: f.factor() (x - 2*zeta6 - 1) * (x - zeta6 - 2) * (x + zeta6 + 1) We can also create spaces corresponding to the groups `\GammaH(N)` intermediate between `\Gamma_0(N)` and `\Gamma_1(N)`:: sage: G = GammaH(30, [11]) sage: M = ModularForms(G, 2); M Modular Forms space of dimension 20 for Congruence Subgroup Gamma_H(30) with H generated by [11] of weight 2 over Rational Field sage: M.T(7).charpoly().factor() (x + 4) * x^2 * (x - 6)^4 * (x + 6)^4 * (x - 8)^7 * (x^2 + 4) More examples of spaces with character:: sage: e = DirichletGroup(5, RationalField()).gen(); e Dirichlet character modulo 5 of conductor 5 mapping 2 |--> -1 sage: m = ModularForms(e, 2); m Modular Forms space of dimension 2, character [-1] and weight 2 over Rational Field sage: m == loads(dumps(m)) True sage: m.T(2).charpoly('x') x^2 - 1 sage: m = ModularForms(e, 6); m.dimension() 4 sage: m.T(2).charpoly('x') x^4 - 917*x^2 - 42284 This came up in a subtle bug (trac #5923):: sage: ModularForms(gp(1), gap(12)) Modular Forms space of dimension 2 for Modular Group SL(2,Z) of weight 12 over Rational Field This came up in another bug (related to trac #8630):: sage: chi = DirichletGroup(109, CyclotomicField(3)).0 sage: ModularForms(chi, 2, base_ring = CyclotomicField(15)) Modular Forms space of dimension 10, character [zeta3 + 1] and weight 2 over Cyclotomic Field of order 15 and degree 8 We create some weight 1 spaces. The first example works fine, since we can prove purely by Riemann surface theory that there are no weight 1 cusp forms:: sage: M = ModularForms(Gamma1(11), 1); M Modular Forms space of dimension 5 for Congruence Subgroup Gamma1(11) of weight 1 over Rational Field sage: M.basis() [ 1 + 22*q^5 + O(q^6), q + 4*q^5 + O(q^6), q^2 - 4*q^5 + O(q^6), q^3 - 5*q^5 + O(q^6), q^4 - 3*q^5 + O(q^6) ] sage: M.cuspidal_subspace().basis() [ ] sage: M == M.eisenstein_subspace() True This example doesn't work so well, because we can't calculate the cusp forms; but we can still work with the Eisenstein series. sage: M = ModularForms(Gamma1(57), 1); M Modular Forms space of dimension (unknown) for Congruence Subgroup Gamma1(57) of weight 1 over Rational Field sage: M.basis() Traceback (most recent call last): ... NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces not implemented in general sage: M.cuspidal_subspace().basis() Traceback (most recent call last): ... NotImplementedError: Computation of dimensions of weight 1 cusp forms spaces not implemented in general sage: E = M.eisenstein_subspace(); E Eisenstein subspace of dimension 36 of Modular Forms space of dimension (unknown) for Congruence Subgroup Gamma1(57) of weight 1 over Rational Field sage: (E.0 + E.2).q_expansion(40) 1 + q^2 + 1473/2*q^36 - 1101/2*q^37 + q^38 - 373/2*q^39 + O(q^40) """ if isinstance(group, dirichlet.DirichletCharacter): if base_ring is None: base_ring = group.minimize_base_ring().base_ring() if base_ring is None: base_ring = rings.QQ if isinstance(group, dirichlet.DirichletCharacter) \ or arithgroup.is_CongruenceSubgroup(group): level = group.level() else: level = group key = canonical_parameters(group, level, weight, base_ring) if use_cache and _cache.has_key(key): M = _cache[key]() if not (M is None): M.set_precision(prec) return M (level, group, weight, base_ring) = key M = None if arithgroup.is_Gamma0(group): M = ambient_g0.ModularFormsAmbient_g0_Q(group.level(), weight) if base_ring != rings.QQ: M = ambient_R.ModularFormsAmbient_R(M, base_ring) elif arithgroup.is_Gamma1(group): M = ambient_g1.ModularFormsAmbient_g1_Q(group.level(), weight) if base_ring != rings.QQ: M = ambient_R.ModularFormsAmbient_R(M, base_ring) elif arithgroup.is_GammaH(group): M = ambient_g1.ModularFormsAmbient_gH_Q(group, weight) if base_ring != rings.QQ: M = ambient_R.ModularFormsAmbient_R(M, base_ring) elif isinstance(group, dirichlet.DirichletCharacter): eps = group if eps.base_ring().characteristic() != 0: # TODO -- implement this # Need to add a lift_to_char_0 function for characters, # and need to still remember eps. raise NotImplementedError, "currently the character must be over a ring of characteristic 0." eps = eps.minimize_base_ring() if eps.is_trivial(): return ModularForms(eps.modulus(), weight, base_ring, use_cache = use_cache, prec = prec) M = ambient_eps.ModularFormsAmbient_eps(eps, weight) if base_ring != eps.base_ring(): M = M.base_extend(base_ring) # ambient_R.ModularFormsAmbient_R(M, base_ring) if M is None: raise NotImplementedError, \ "computation of requested space of modular forms not defined or implemented" M.set_precision(prec) _cache[key] = weakref.ref(M) return M | 85a7ba1c22c2f4ed1319f21ffb2202f6b33066a8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/85a7ba1c22c2f4ed1319f21ffb2202f6b33066a8/constructor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3431,
2490,
18529,
12,
1655,
225,
273,
404,
16,
3119,
273,
576,
16,
1026,
67,
8022,
273,
599,
16,
999,
67,
2493,
273,
1053,
16,
13382,
273,
3467,
18,
5280,
67,
3670,
26913,
4672,
436,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3431,
2490,
18529,
12,
1655,
225,
273,
404,
16,
3119,
273,
576,
16,
1026,
67,
8022,
273,
599,
16,
999,
67,
2493,
273,
1053,
16,
13382,
273,
3467,
18,
5280,
67,
3670,
26913,
4672,
436,
... |
def get_widget_data(self): index = self.widget.get_active() if index < 0: return Undefined else: model = self.widget.get_model() return model[index][1] def set_widget_data(self, data): try: index = self.values.index(data) except: index = -1 self.widget.set_active(index) class Display_Bool_As_Combobox(As_Combobox, Display): def prepare_widget(self, combobox): model = gtk.ListStore(str, object) combobox.set_model(model) cell = gtk.CellRendererText() combobox.pack_start(cell, True) combobox.add_attribute(cell, 'text', 0) adict = {'True': True, 'False': False} if self.check.required is False: adict.update({'None': None}) self.values = adict.values() model = combobox.get_model() model.clear() for key, value in adict.iteritems(): model.append((key, value)) class Display_Choice_As_Combobox(As_Combobox, Display): | def create_widget(self): return gtk.ComboBox() | 5bbfb1b188c0bc1ccd63f8c4b180da540b762941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2510/5bbfb1b188c0bc1ccd63f8c4b180da540b762941/checkwidgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
6587,
12,
2890,
4672,
327,
22718,
18,
22199,
1435,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
6587,
12,
2890,
4672,
327,
22718,
18,
22199,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
order = self.pool.get('pos.order').browse(cr, uid, active_id) if order.amount_total == order.amount_paid: res['arch'] = """ <form string="Make Payment" colspan="4"> <group col="2" colspan="2"> <label string="Do you want to print the Receipt?" colspan="4"/> <separator colspan="4"/> <button icon="gtk-cancel" special="cancel" string="No" readonly="0"/> <button name="print_report" string="Print Receipt" type="object" icon="gtk-print"/> </group> </form> """ return res | try: order = self.pool.get('pos.order').browse(cr, uid, active_id) if order.amount_total == order.amount_paid: res['arch'] = """ <form string="Make Payment" colspan="4"> <group col="2" colspan="2"> <label string="Do you want to print the Receipt?" colspan="4"/> <separator colspan="4"/> <button icon="gtk-cancel" special="cancel" string="No" readonly="0"/> <button name="print_report" string="Print Receipt" type="object" icon="gtk-print"/> </group> </form> """ except: return result return result | def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): """ Changes the view dynamically @param self: The object pointer. @param cr: A database cursor @param uid: ID of the user currently logged in @param context: A standard dictionary @return: New arch of view. """ result = super(pos_make_payment, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False) active_model = context.get('active_model') if not active_model and active_model != 'pos.order': return result active_id = context.get('active_id', False) if active_id: order = self.pool.get('pos.order').browse(cr, uid, active_id) if order.amount_total == order.amount_paid: res['arch'] = """ <form string="Make Payment" colspan="4"> <group col="2" colspan="2"> <label string="Do you want to print the Receipt?" colspan="4"/> <separator colspan="4"/> <button icon="gtk-cancel" special="cancel" string="No" readonly="0"/> <button name="print_report" string="Print Receipt" type="object" icon="gtk-print"/> </group> </form> """ return res | 56ded53b7c4ecc641bb26ee15d6f0d72b900ebed /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/56ded53b7c4ecc641bb26ee15d6f0d72b900ebed/pos_payment.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
1945,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1476,
67,
350,
33,
7036,
16,
1476,
67,
723,
2218,
687,
2187,
819,
33,
7036,
16,
12748,
33,
8381,
16,
27539,
33,
8381,
4672,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1466,
67,
1945,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
1476,
67,
350,
33,
7036,
16,
1476,
67,
723,
2218,
687,
2187,
819,
33,
7036,
16,
12748,
33,
8381,
16,
27539,
33,
8381,
4672,... |
proxies['https'] = 'http://%s' % proxyServer | proxies['https'] = 'https://%s' % proxyServer | def getproxies_registry(): """Return a dictionary of scheme -> proxy server URL mappings. | fe91c5fb4a770aec6a1bbfdd9b9f2c4fae4d9434 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/fe91c5fb4a770aec6a1bbfdd9b9f2c4fae4d9434/request.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
20314,
606,
67,
9893,
13332,
3536,
990,
279,
3880,
434,
4355,
317,
2889,
1438,
1976,
7990,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
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,
336,
20314,
606,
67,
9893,
13332,
3536,
990,
279,
3880,
434,
4355,
317,
2889,
1438,
1976,
7990,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
j_3 + abs(m_3)) | j_3 + abs(m_3)) | def wigner_3j(j_1, j_2, j_3, m_1, m_2, m_3, prec=None): r""" Calculate the Wigner 3j symbol `Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3)`. INPUT: - ``j_1``, ``j_2``, ``j_3``, ``m_1``, ``m_2``, ``m_3`` - integer or half integer - ``prec`` - precision, default: None. Providing a precision can drastically speed up the calculation. OUTPUT: rational number times the square root of a rational number (if prec=None), or real number if a precision is given EXAMPLES:: sage: wigner_3j(2, 6, 4, 0, 0, 0) sqrt(5/143) sage: wigner_3j(2, 6, 4, 0, 0, 1) 0 sage: wigner_3j(0.5, 0.5, 1, 0.5, -0.5, 0) sqrt(1/6) sage: wigner_3j(40, 100, 60, -10, 60, -50) 95608/18702538494885*sqrt(21082735836735314343364163310/220491455010479533763) sage: wigner_3j(2500, 2500, 5000, 2488, 2400, -4888, prec=64) 7.60424456883448589e-12 It is an error to have arguments that are not integer or half integer values:: sage: wigner_3j(2.1, 6, 4, 0, 0, 0) Traceback (most recent call last): ... ValueError: j values must be integer or half integer sage: wigner_3j(2, 6, 4, 1, 0, -1.1) Traceback (most recent call last): ... ValueError: m values must be integer or half integer NOTES: The Wigner 3j symbol obeys the following symmetry rules: - invariant under any permutation of the columns (with the exception of a sign change where `J:=j_1+j_2+j_3`): .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =Wigner3j(j_3,j_1,j_2,m_3,m_1,m_2) =Wigner3j(j_2,j_3,j_1,m_2,m_3,m_1) =(-1)^J Wigner3j(j_3,j_2,j_1,m_3,m_2,m_1) =(-1)^J Wigner3j(j_1,j_3,j_2,m_1,m_3,m_2) =(-1)^J Wigner3j(j_2,j_1,j_3,m_2,m_1,m_3) - invariant under space inflection, i. e. .. math:: Wigner3j(j_1,j_2,j_3,m_1,m_2,m_3) =(-1)^J Wigner3j(j_1,j_2,j_3,-m_1,-m_2,-m_3) - symmetric with respect to the 72 additional symmetries based on the work by [Regge58] - zero for `j_1`, `j_2`, `j_3` not fulfilling triangle relation - zero for `m_1+m_2+m_3\neq 0` - zero for violating any one of the conditions `j_1\ge|m_1|`, `j_2\ge|m_2|`, `j_3\ge|m_3|` ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 3j symbol exactly. Note that the formula contains alternating sums over large factorials and is therefore unsuitable for finite precision arithmetic and only useful for a computer algebra system [Rasch03]. REFERENCES: - [Regge58] 'Symmetry Properties of Clebsch-Gordan Coefficients', T. Regge, Nuovo Cimento, Volume 10, pp. 544 (1958) - [Edmonds74] 'Angular Momentum in Quantum Mechanics', A. R. Edmonds, Princeton University Press (1974) - [Rasch03] 'Efficient Storage Scheme for Pre-calculated Wigner 3j, 6j and Gaunt Coefficients', J. Rasch and A. C. H. Yu, SIAM J. Sci. Comput. Volume 25, Issue 4, pp. 1416-1428 (2003) AUTHORS: - Jens Rasch (2009-03-24): initial version """ if int(j_1 * 2) != j_1 * 2 or int(j_2 * 2) != j_2 * 2 or \ int(j_3 * 2) != j_3 * 2: raise ValueError("j values must be integer or half integer") if int(m_1 * 2) != m_1 * 2 or int(m_2 * 2) != m_2 * 2 or \ int(m_3 * 2) != m_3 * 2: raise ValueError("m values must be integer or half integer") if (m_1 + m_2 + m_3 <> 0): return 0 prefid = Integer((-1) ** (int(j_1 - j_2 - m_3))) m_3 = -m_3 a1 = j_1 + j_2 - j_3 if (a1 < 0): return 0 a2 = j_1 - j_2 + j_3 if (a2 < 0): return 0 a3 = -j_1 + j_2 + j_3 if (a3 < 0): return 0 if (abs(m_1) > j_1) or (abs(m_2) > j_2) or (abs(m_3) > j_3): return 0 maxfact = max(j_1 + j_2 + j_3 + 1, j_1 + abs(m_1), j_2 + abs(m_2), \ j_3 + abs(m_3)) _calc_factlist(maxfact) argsqrt = Integer(_Factlist[int(j_1 + j_2 - j_3)] * \ _Factlist[int(j_1 - j_2 + j_3)] * \ _Factlist[int(-j_1 + j_2 + j_3)] * \ _Factlist[int(j_1 - m_1)] * \ _Factlist[int(j_1 + m_1)] * \ _Factlist[int(j_2 - m_2)] * \ _Factlist[int(j_2 + m_2)] * \ _Factlist[int(j_3 - m_3)] * \ _Factlist[int(j_3 + m_3)]) / \ _Factlist[int(j_1 + j_2 + j_3 + 1)] ressqrt = argsqrt.sqrt(prec) if type(ressqrt) is ComplexNumber: ressqrt = ressqrt.real() imin = max(-j_3 + j_1 + m_2, -j_3 + j_2 - m_1, 0) imax = min(j_2 + m_2, j_1 - m_1, j_1 + j_2 - j_3) sumres = 0 for ii in range(imin, imax + 1): den = _Factlist[ii] * \ _Factlist[int(ii + j_3 - j_1 - m_2)] * \ _Factlist[int(j_2 + m_2 - ii)] * \ _Factlist[int(j_1 - ii - m_1)] * \ _Factlist[int(ii + j_3 - j_2 + m_1)] * \ _Factlist[int(j_1 + j_2 - j_3 - ii)] sumres = sumres + Integer((-1) ** ii) / den res = ressqrt * sumres * prefid return res | 7df69c5c6f107763eb9f25a2174930b0961c0f48 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/7df69c5c6f107763eb9f25a2174930b0961c0f48/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
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,
341,
724,
264,
67,
23,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
312,
67,
21,
16,
312,
67,
22,
16,
312,
67,
23,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
pos=wxPoint(0, 0), size=wxSize(142, 99), style=0) self.staticBox1.SetConstraints(LayoutAnchors(self.staticBox1, false, true, true, false)) | pos=wxPoint(0, 0), size=wxSize(157, 112), style=0) self.staticBox1.SetConstraints(LayoutAnchors(self.staticBox1, False, True, True, False)) | def _init_ctrls(self, prnt): # generated method, don't edit wxDialog.__init__(self, id=wxID_STCSTYLEEDITDLG, name='STCStyleEditDlg', parent=prnt, pos=wxPoint(583, 291), size=wxSize(459, 482), style=wxWANTS_CHARS | wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER, title=self.stc_title) self._init_utils() self.SetClientSize(wxSize(451, 455)) self.SetAutoLayout(true) self.SetSizeHints(425, 400, -1, -1) self.Center(wxBOTH) EVT_SIZE(self, self.OnStcstyleeditdlgSize) | aac0471ac41eaa175cbaa05604248123746b2b22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/aac0471ac41eaa175cbaa05604248123746b2b22/STCStyleEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
882,
39,
15066,
10776... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2738,
67,
16277,
87,
12,
2890,
16,
846,
496,
4672,
468,
4374,
707,
16,
2727,
1404,
3874,
7075,
6353,
16186,
2738,
972,
12,
2890,
16,
612,
33,
27226,
734,
67,
882,
39,
15066,
10776... |
distro_virt.setAttribute("value", True) | distro_virt.setAttribute("value", "1") | def _get_distro_requires(self): drs = xml.dom.minidom.parseString(self._distro_requires) # If no distro_virt is asked for default to Virt if not drs.getElementsByTagName("distro_virt"): distroRequires = self.doc.createElement("distroRequires") for dr in drs.getElementsByTagName("distroRequires"): for child in dr.childNodes[:]: distroRequires.appendChild(child) distro_virt = self.doc.createElement("distro_virt") distro_virt.setAttribute("op", "=") distro_virt.setAttribute("value", True) distroRequires.appendChild(distro_virt) return distroRequires.toxml() else: return self._distro_requires | 892209f36b4774b95e2b60a143407bbfc6764703 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14755/892209f36b4774b95e2b60a143407bbfc6764703/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
4413,
303,
67,
18942,
12,
2890,
4672,
5081,
87,
273,
2025,
18,
9859,
18,
1154,
350,
362,
18,
2670,
780,
12,
2890,
6315,
4413,
303,
67,
18942,
13,
468,
971,
1158,
27450,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4413,
303,
67,
18942,
12,
2890,
4672,
5081,
87,
273,
2025,
18,
9859,
18,
1154,
350,
362,
18,
2670,
780,
12,
2890,
6315,
4413,
303,
67,
18942,
13,
468,
971,
1158,
27450,
... |
while len(unprocessed_pkgs) > 0: for pkg in unprocessed_pkgs.keys(): if not final_pkgobjs.has_key(pkg): final_pkgobjs[pkg] = None deplist = self.getPackageDeps(pkg) for dep in deplist: if not unprocessed_pkgs.has_key(dep) and not final_pkgobjs.has_key(dep): unprocessed_pkgs[dep] = None del unprocessed_pkgs[pkg] | moretoprocess = True while moretoprocess: for txmbr in self.tsInfo: if not final_pkgobjs.has_key(txmbr.po): final_pkgobjs[txmbr.po] = None self.getPackageDeps(txmbr.po) else: moretoprocess = False | def getPackageObjects(self): """Cycle through the list of packages, get package object matches, and resolve deps. | 003ceaa7bee4cafe9e85a8ea126127235c6eb38a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8489/003ceaa7bee4cafe9e85a8ea126127235c6eb38a/gather.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11506,
4710,
12,
2890,
4672,
3536,
13279,
3059,
326,
666,
434,
5907,
16,
336,
2181,
733,
1885,
16,
471,
2245,
8740,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11506,
4710,
12,
2890,
4672,
3536,
13279,
3059,
326,
666,
434,
5907,
16,
336,
2181,
733,
1885,
16,
471,
2245,
8740,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
"Reorients the model so that it is viewed from the left side."\ | "Orients the view to the Left View."\ | def createWhatsThis(self): ############################################## # File Toolbar ############################################## #### Open File #### fileOpenText = "<u><b>Open File</b></u> (Ctrl + O)</b></p><br> "\ "<p><img source=\"fileopen\"><br> "\ "Opens a new file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "fileopen", self.fileOpenAction.iconSet().pixmap() ) self.fileOpenAction.setWhatsThis( fileOpenText ) #### Save File #### fileSaveText = "<u><b>Save File</b></u> (Ctrl + S)</b></p><br> "\ "<p><img source=\"filesave\"><br> "\ "Saves the current file."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "filesave", self.fileSaveAction.iconSet().pixmap() ) self.fileSaveAction.setWhatsThis( fileSaveText ) ############################################## # Edit Toolbar ############################################## #### Undo #### editUndoText = "<u><b>Undo</b></u> (Ctrl + Z)</b></p><br> "\ "<p><img source=\"editUndo\"><br> "\ "Reverses the last edit or command to the active part. "\ "<b>Currently not implemented</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editUndo", self.editUndoAction.iconSet().pixmap() ) self.editUndoAction.setWhatsThis( editUndoText ) #### Redo #### editRedoText = "<u><b>Redo</b></u> (Ctrl + Y)</b></p><br> "\ "<p><img source=\"editRedo\"> <br>"\ "Re-applies the actions or commands on which you have used "\ "the Undo command. <b>Currently not implemented</b>."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editRedo", self.editRedoAction.iconSet().pixmap() ) self.editRedoAction.setWhatsThis( editRedoText ) #### Cut #### editCutText = "<u><b>Cut</b></u> (Ctrl + X)</b></p><br> "\ "<p><img source=\"editCut\"><br> "\ "Removes the selected object(s) and stores the cut data on the"\ "clipboard."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCut", self.editCutAction.iconSet().pixmap() ) self.editCutAction.setWhatsThis( editCutText ) #### Copy #### editCopyText = "<u><b>Copy</b></u> (Ctrl + C)</b></p><br> "\ "<p><img source=\"editCopy\"><br> "\ "Places a copy of the selected chunk(s) on the clipboard "\ "while leaving the original chunk(s) unaffected."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editCopy", self.editCopyAction.iconSet().pixmap() ) self.editCopyAction.setWhatsThis( editCopyText ) #### Paste #### editPasteText = "<u><b>Paste</b></u> (Ctrl + V)</b></p><br> "\ "<p><img source=\"editPaste\"><br> "\ "When selecting this feature, you are placed in "\ "<b>Build Atom</b> mode where you may paste copies "\ "of clipboard objects into the model where ever you click."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editPaste", self.editPasteAction.iconSet().pixmap() ) self.editPasteAction.setWhatsThis( editPasteText ) #### Delete #### editDeleteText = "<u><b>Delete</b></u> (DEL)</b></p><br> "\ "<p><img source=\"editDelete\"><br> "\ "Deletes the selected object(s). "\ "For this Alpha release, deleted objects are permanantly lost.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "editDelete", self.editDeleteAction.iconSet().pixmap() ) self.editDeleteAction.setWhatsThis( editDeleteText ) ############################################## # View Toolbar ############################################## #### Home View #### setViewHomeActionText = "<u><b>Home</b></u> (Home)<br>"\ "<p><img source=\"setViewHome\"><br> "\ "When you create a new model, it appears in a default view orientation (FRONT view). When you open an existing model, it appears in the orientation it was last saved. You can change the default orientation by selecting <b>Set Home View to Current View</b> from the <b>View</b> menu.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewHome", self.setViewHomeAction.iconSet().pixmap() ) self.setViewHomeAction.setWhatsThis( setViewHomeActionText ) #### Fit to Window #### setViewFitToWindowActionText = "<u><b>Fit To Window</b></u><br>"\ "<p><img source=\"setViewFitToWindow\"><br> "\ "Refits the model to the screen so you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFitToWindow", self.setViewFitToWindowAction.iconSet().pixmap() ) self.setViewFitToWindowAction.setWhatsThis( setViewFitToWindowActionText ) #### Recenter #### setViewRecenterActionText = "<u><b>Recenter</b></u><br>"\ "<p><img source=\"setViewRecenter\"><br> "\ "Changes the view center and zoom factor so that the origin is in the "\ "center of the view and you can view the entire model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRecenter", self.setViewRecenterAction.iconSet().pixmap() ) self.setViewRecenterAction.setWhatsThis( setViewRecenterActionText ) #### Zoom Tool #### setzoomToolActionText = "<u><b>Zoom Tool</b></u><br>"\ "<p><img source=\"setzoomTool\"><br> "\ "Allows the user to zoom into a specific area of the model by specifying a rectangular area. "\ "This is done by holding down the left button and dragging the mouse.</p>"\ "<p>A mouse with a mouse wheel can also be used to zoom in and out "\ "at any time, without using the Zoom Tool.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setzoomTool", self.zoomToolAction.iconSet().pixmap() ) self.zoomToolAction.setWhatsThis( setzoomToolActionText ) #### Pan Tool #### setpanToolActionText = "<u><b>Pan Tool</b></u><br>"\ "<p><img source=\"setpanTool\"><br> "\ "Allows X-Y panning using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can pan the model at any time by pressing "\ "the middle mouse button while holding down the Shift key.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setpanTool", self.panToolAction.iconSet().pixmap() ) self.panToolAction.setWhatsThis( setpanToolActionText ) #### Rotate Tool #### setrotateToolActionText = "<u><b>Rotate Tool</b></u><br>"\ "<p><img source=\"setrotateTool\"><br> "\ "Allows free rotation using the left mouse button.</p>"\ "<p>Users with a 3-button mouse can rotate the model at any time by pressing "\ "the middle mouse button and dragging the mouse.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setrotateTool", self.rotateToolAction.iconSet().pixmap() ) self.rotateToolAction.setWhatsThis( setrotateToolActionText ) #### Orthographic Projection #### setViewOrthoActionText = "<u><b>Orthographic Projection</b></u><br>"\ "<p><img source=\"setViewOrtho\"><br> "\ "Sets nonperspective (or parallel) projection, with no foreshortening."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOrtho", self.setViewOrthoAction.iconSet().pixmap() ) self.setViewOrthoAction.setWhatsThis( setViewOrthoActionText ) #### Perspective Projection #### setViewPerspecActionText = "<u><b>Perspective Projection</b></u><br>"\ "<p><img source=\"setViewPerspec\"><br> "\ "Set perspective projection, drawing objects slightly larger "\ "that are closer to the viewer."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewPerspec", self.setViewPerspecAction.iconSet().pixmap() ) self.setViewPerspecAction.setWhatsThis( setViewPerspecActionText ) #### Front View #### setViewFrontActionText = "<u><b>Front View</b></u><br>"\ "<p><img source=\"setViewFront\"><br> "\ "Reorients the model so that it is viewed from the front."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewFront", self.setViewFrontAction.iconSet().pixmap() ) self.setViewFrontAction.setWhatsThis( setViewFrontActionText ) #### Back View #### setViewBackActionText = "<u><b>Back View</b></u><br>"\ "<p><img source=\"setViewBack\"><br> "\ "Reorients the model so that it is viewed from the back."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBack", self.setViewBackAction.iconSet().pixmap() ) self.setViewBackAction.setWhatsThis( setViewBackActionText ) #### Top View #### setViewTopActionText = "<u><b>Top View</b></u><br>"\ "<p><img source=\"setViewTop\"><br> "\ "Reorients the model so that it is viewed from the top."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewTop", self.setViewTopAction.iconSet().pixmap() ) self.setViewTopAction.setWhatsThis( setViewTopActionText ) #### Bottom View #### setViewBottomActionText = "<u><b>Bottom View</b></u><br>"\ "<p><img source=\"setViewBottom\"><br> "\ "Reorients the model so that it is viewed from the bottom."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewBottom", self.setViewBottomAction.iconSet().pixmap() ) self.setViewBottomAction.setWhatsThis( setViewBottomActionText ) #### Left View #### setViewLeftActionText = "<u><b>Left View</b></u><br>"\ "<p><img source=\"setViewLeft\"><br> "\ "Reorients the model so that it is viewed from the left side."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewLeft", self.setViewLeftAction.iconSet().pixmap() ) self.setViewLeftAction.setWhatsThis( setViewLeftActionText ) #### Right View #### setViewRightActionText = "<u><b>Right View</b></u><br>"\ "<p><img source=\"setViewRight\"><br> "\ "Reorients the model so that it is viewed from the right side."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewRight", self.setViewRightAction.iconSet().pixmap() ) self.setViewRightAction.setWhatsThis( setViewRightActionText ) #### Opposite View #### setViewOppositeActionText = "<u><b>Opposite View</b></u><br>"\ "<p><img source=\"setViewOpposite\"><br> "\ "Reorients the model so that it is viewed from the opposite side of the current view."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "setViewOpposite", self.setViewOppositeAction.iconSet().pixmap() ) self.setViewOppositeAction.setWhatsThis( setViewOppositeActionText ) ############################################## # Grids Toolbar ############################################## #### Surface 100 #### orient100ActionText = "<u><b>Surface 100</b></u><br>"\ "<p><img source=\"orient100Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,0,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient100Action", self.orient100Action.iconSet().pixmap() ) self.orient100Action.setWhatsThis(orient100ActionText ) #### Surface 110 #### orient110ActionText = "<u><b>Surface 110</b></u><br>"\ "<p><img source=\"orient110Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,0) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient110Action", self.orient110Action.iconSet().pixmap() ) self.orient110Action.setWhatsThis(orient110ActionText ) #### Surface 111 #### orient111ActionText = "<u><b>Surface 111</b></u><br>"\ "<p><img source=\"orient111Action\"><br> "\ "Reorients the view to the nearest angle that would "\ "look straight into a (1,1,1) surface of a diamond lattice."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "orient111Action", self.orient111Action.iconSet().pixmap() ) self.orient111Action.setWhatsThis(orient111ActionText ) ############################################## # Molecular Display toolbar ############################################## #### Display Default #### dispDefaultActionText = "<u><b>Display Default</b></u><br>"\ "<p><img source=\"dispDefaultAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Default</b> , rendering them in the <b>Current Display Mode</b>."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to the <b>Default Display Mode</b>. " \ "All chunks with their display setting set to <b>Default</b> will be rendered in the "\ "<b>Default Display Mode</b>."\ "</p>"\ "<p>The <b>Default Display Mode</b> can be changed via the "\ "<b>Edit > Preferences</b> menu and selecting the <b>General</b> tab."\ "</p>"\ "<p>The <b>Current or Default Display Mode</b> is displayed in the status bar in the "\ "lower right corner of the main window."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDefaultAction", self.dispDefaultAction.iconSet().pixmap() ) self.dispDefaultAction.setWhatsThis(dispDefaultActionText ) #### Display Invisible #### dispInvisActionText = "<u><b>Display Invisible</b></u><br>"\ "<p><img source=\"dispInvisAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Invisible</b>, making them invisible."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Invisible</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispInvisAction", self.dispInvisAction.iconSet().pixmap() ) self.dispInvisAction.setWhatsThis(dispInvisActionText ) #### Display Lines #### dispLinesActionText = "<u><b>Display Lines</b></u><br>"\ "<p><img source=\"dispLinesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ " <b>Lines</b>. Only bonds are rendered as colored lines."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Lines</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispLinesAction", self.dispLinesAction.iconSet().pixmap() ) self.dispLinesAction.setWhatsThis(dispLinesActionText ) #### Display Tubes #### dispTubesActionText = "<u><b>Display Tubes</b></u><br>"\ "<p><img source=\"dispTubesAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Tubes</b>. Atoms and bonds are rendered as colored tubes."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>Tubes</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTubesAction", self.dispTubesAction.iconSet().pixmap() ) self.dispTubesAction.setWhatsThis(dispTubesActionText ) #### Display CPK #### dispCPKActionText = "<u><b>Display CPK</b></u><br>"\ "<p><img source=\"dispCPKAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>CPK</b> mode, also known as <b>\"Ball and Sticks\"</b> mode. Atoms are rendered "\ "as spheres and bonds are rendered as narrow cylinders."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>CPK</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCPKAction", self.dispCPKAction.iconSet().pixmap() ) self.dispCPKAction.setWhatsThis(dispCPKActionText ) #### Display VdW #### dispVdWActionText = "<u><b>Display VdW</b></u><br>"\ "<p><img source=\"dispVdWAction\"><br> "\ "Changes the <i>display setting</i> of selected atoms or chunks to "\ "<b>Van der Waals</b> mode. Atoms are rendered as spheres with "\ "a size equal to the VdW radius. Bonds are not rendered."\ "</p>"\ "<p>If no atoms or chunks are selected, then this action will change the "\ "<b>Current Display Mode</b> of the 3D workspace to <b>VdW</b>. " \ "All chunks with their display setting set to <b>Default</b> will inherit "\ "this display property."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispVdWAction", self.dispVdWAction.iconSet().pixmap() ) self.dispVdWAction.setWhatsThis(dispVdWActionText ) ############################################## # Select toolbar ############################################## #### Select All #### selectAllActionText = "<u><b>Select All</b></u> (Ctrl + A)</b></p><br>"\ "<p><img source=\"selectAllAction\"><br> "\ "During <b>Select Atoms</b> mode, this will select all the atoms in "\ "the model. Otherwise, this will select all the chunks in the model."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectAllAction", self.selectAllAction.iconSet().pixmap() ) self.selectAllAction.setWhatsThis(selectAllActionText ) #### Select None #### selectNoneActionText = "<u><b>Select None</b></u></p><br>"\ "<p><img source=\"selectNoneAction\"><br> "\ "Unselects everything currently selected.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectNoneAction", self.selectNoneAction.iconSet().pixmap() ) self.selectNoneAction.setWhatsThis(selectNoneActionText ) #### Invert Selection #### selectInvertActionText = "<u><b>Invert Selection</b></u> <br> (Ctrl + Shift + I)</b></p><br>"\ "<p><img source=\"selectInvertAction\"><br> "\ "Inverts the current selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectInvertAction", self.selectInvertAction.iconSet().pixmap() ) self.selectInvertAction.setWhatsThis(selectInvertActionText ) #### Select Connected #### selectConnectedActionText = "<u><b>Select Connected</b></u> (Ctrl + Shift + C)</b></p><br>"\ "<p><img source=\"selectConnectedAction\"><br> "\ "Selects all the atoms that can be reached by the currently selected atom "\ "via an unbroken chain of bonds. </p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectConnectedAction", self.selectConnectedAction.iconSet().pixmap() ) self.selectConnectedAction.setWhatsThis(selectConnectedActionText ) #### Select Doubly #### selectDoublyActionText = "<u><b>Select Doubly</b></u> (Ctrl + Shift + D)</b></p><br>"\ "<p><img source=\"selectDoublyAction\"><br> "\ "Selects all the atoms that can be reached from a currently selected "\ "atom through two disjoint unbroken chains of bonds. Atoms singly "\ "connected to this group and unconnected to anything else are also "\ "included in the selection.</p>"\ "<p>To use this feature, you must first be in "\ "<b>Select Atoms</b> mode and select at least one atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "selectDoublyAction", self.selectDoublyAction.iconSet().pixmap() ) self.selectDoublyAction.setWhatsThis(selectDoublyActionText ) ############################################## # Modify Toolbar ############################################## #### Minimize Selection #### modifyMinimizeSelActionText = "<u><b>Minimize Selection</b></u> (Ctrl + M)</b></p><br>"\ "<p><img source=\"modifyMinimizeSelAction\"><br> "\ "Arranges the atoms (<i>of the current selection</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeSelAction", self.modifyMinimizeSelAction.iconSet().pixmap() ) self.modifyMinimizeSelAction.setWhatsThis(modifyMinimizeSelActionText ) #### Minimize All #### modifyMinimizeAllActionText = "<u><b>Minimize All</b></u></p><br>"\ "<p><img source=\"modifyMinimizeAllAction\"><br> "\ "Arranges the atoms (<i>of the entire part</i>) to their chemically stable point of "\ "equilibrium in reference to the other atoms in the structure."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMinimizeAllAction", self.modifyMinimizeAllAction.iconSet().pixmap() ) self.modifyMinimizeAllAction.setWhatsThis(modifyMinimizeAllActionText ) #### Hydrogenate #### modifyHydrogenateActionText = "<u><b>Hydrogenate</b></u> </b></p><br>"\ "<p><img source=\"modifyHydrogenateAction\"><br> "\ "Adds hydrogen atoms to all the open bonds in the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyHydrogenateAction", self.modifyHydrogenateAction.iconSet().pixmap() ) self.modifyHydrogenateAction.setWhatsThis(modifyHydrogenateActionText ) #### Dehydrogenate #### modifyDehydrogenateActionText = "<u><b>Dehydrogenate</b></u><br>"\ "<p><img source=\"modifyDehydrogenateAction\"><br> "\ "Removes all hydrogen atoms from the selection.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDehydrogenateAction", self.modifyDehydrogenateAction.iconSet().pixmap() ) self.modifyDehydrogenateAction.setWhatsThis(modifyDehydrogenateActionText ) #### Passivate #### modifyPassivateActionText = "<u><b>Passivate</b></u> (Ctrl + P)</b></p><br>"\ "<p><img source=\"modifyPassivateAction\"><br> "\ "Changes the types of incompletely bonded atoms to atoms with the "\ "right number of bonds, using atoms with the best atomic radius."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyPassivateAction", self.modifyPassivateAction.iconSet().pixmap() ) self.modifyPassivateAction.setWhatsThis(modifyPassivateActionText ) #### Stretch #### modifyStretchActionText = "<u><b>Stretch</b></u><br>"\ "<p><img source=\"modifyStretchAction\"><br> "\ "Stretches the bonds of the selected chunk(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyStretchAction", self.modifyStretchAction.iconSet().pixmap() ) self.modifyStretchAction.setWhatsThis(modifyStretchActionText ) #### Delete Bonds #### modifyDeleteBondsActionText = "<u><b>Delete Bonds</b></u><br>"\ "<p><img source=\"modifyDeleteBondsAction\"><br> "\ "Delete all bonds between selected and unselected atoms or chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyDeleteBondsAction", self.modifyDeleteBondsAction.iconSet().pixmap() ) self.modifyDeleteBondsAction.setWhatsThis(modifyDeleteBondsActionText ) #### Separate #### modifySeparateActionText = "<u><b>Separate</b></u><br>"\ "<p><img source=\"modifySeparateAction\"><br> "\ "Creates a new chunk from the currently selected atoms.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifySeparateAction", self.modifySeparateAction.iconSet().pixmap() ) self.modifySeparateAction.setWhatsThis(modifySeparateActionText ) #### Merge Chunks #### modifyMergeActionText = "<u><b>Merge Chunks</b></u><br>"\ "<p><img source=\"modifyMergeAction\"><br> "\ "Merges two or more chunks into a single chunk.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyMergeAction", self.modifyMergeAction.iconSet().pixmap() ) self.modifyMergeAction.setWhatsThis(modifyMergeActionText ) #### Invert Chunks #### modifyInvertActionText = "<u><b>Invert</b></u><br>"\ "<p><img source=\"modifyInvertAction\"><br> "\ "Inverts the atoms of the selected chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyInvertAction", self.modifyInvertAction.iconSet().pixmap() ) self.modifyInvertAction.setWhatsThis(modifyInvertActionText ) #### Align to Common Axis #### modifyAlignCommonAxisActionText = "<u><b>Align To Common Axis</b></u><br>"\ "<p><img source=\"modifyAlignCommonAxis\"><br> "\ "Aligns one or more chunks to the axis of the first selected chunk."\ "You must select two or more chunks before using this feature."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "modifyAlignCommonAxis", self. modifyAlignCommonAxisAction.iconSet().pixmap() ) self. modifyAlignCommonAxisAction.setWhatsThis( modifyAlignCommonAxisActionText ) ############################################## # Tools Toolbar ############################################## #### Select Chunks #### toolsSelectMoleculesActionText = "<u><b>Select Chunks</b></u><!-- [[Feature:Select Chunks Mode]] --><br>"\ "<p><img source=\" toolsSelectMoleculesAction\"><br> "\ "<b>Select Chunks</b> allows you to select/unselect chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects a chunk(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes chunk(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds chunk(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectMoleculesAction", self. toolsSelectMoleculesAction.iconSet().pixmap() ) self. toolsSelectMoleculesAction.setWhatsThis( toolsSelectMoleculesActionText ) #### Select Atoms #### toolsSelectAtomsActionText = "<u><b>Select Atoms</b></u><!-- [[Feature:Select Atoms Mode]] --><br>"\ "<p><img source=\" toolsSelectAtomsAction\"><br> "\ "<b>Select Atoms</b> allows you to select/unselect atoms with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click/Drag</b> - selects an atom(s).</p>"\ "<p><b>Ctrl+Left Click/Drag</b> - removes atom(s) from selection.</p>"\ "<p><b>Shift+Left Click/Drag</b> - adds atom(s) to selection."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsSelectAtomsAction", self. toolsSelectAtomsAction.iconSet().pixmap() ) self. toolsSelectAtomsAction.setWhatsThis( toolsSelectAtomsActionText ) #### Move Chunks #### toolsMoveMoleculeActionText = "<u><b>Move Chunks</b></u><!-- [[Feature:Move Chunks Mode]] --><br>"\ "<p><img source=\" toolsMoveMoleculeAction\"><br> "\ "Activates <b>Move Chunks</b> mode, allowing you to select, "\ "move and rotate one of more chunks with the mouse.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Drag</b> - moves the selected chunk(s).</p>"\ "<p><b>Ctrl+Left Drag</b> - freely rotates selected chunk(s).</p>"\ "<p><b>Shift+Left Drag</b> - constrained movement and rotation of a chunk about its own axis."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsMoveMoleculeAction", self. toolsMoveMoleculeAction.iconSet().pixmap() ) self. toolsMoveMoleculeAction.setWhatsThis( toolsMoveMoleculeActionText ) #### Build Atoms Tool #### toolsDepositAtomActionText = "<u><b>Build Tool</b></u><!-- [[Feature:Build Mode]] --><br>"\ "<p><img source=\" toolsDepositAtomAction\"><br> "\ "<b>Build Tool</b> allows you to deposit individual atoms or add/move/delete "\ "atoms from an existing chunk. Build Tool can also be used to paste "\ "copies of chunks from the clipboard into the part.</p>"\ "<p><b><u>Mouse/Key Combinations</u></b></p>"\ "<p><b>Left Click</b> - adds an atom or pastes a chunk from the clipboard. "\ "New atoms can be connected to an existing chunk if an open bond is highlighted "\ "during a left click.</p>"\ "<p><b>Ctrl+Left Click</b> - deletes a highlighted atom or bond.</p>"\ "<p><b>Shift+Left Drag</b> - moves an atom or open bond. An open bond will be "\ "connected to another open bond if the mouse button is released over a different "\ "open bond."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDepositAtomAction", self. toolsDepositAtomAction.iconSet().pixmap() ) self. toolsDepositAtomAction.setWhatsThis( toolsDepositAtomActionText ) #### Cookie Cutter #### toolsCookieCutActionText = "<u><b>Cookie Cutter Tool</b></u><!-- [[Feature:Cookie Cutter Mode]] --><br>"\ "<p><><img source=\" toolsCookieCutAction\"><br> "\ "Activates <b>Cookie Cutter</b> mode, allowing you to cut out 3-D shapes from a "\ "slab of diamond or lonsdaleite lattice.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCookieCutAction", self. toolsCookieCutAction.iconSet().pixmap() ) self. toolsCookieCutAction.setWhatsThis( toolsCookieCutActionText ) #### Extrude Tool #### toolsExtrudeActionText = "<u><b>Extrude Tool</b></u><!-- [[Feature:Extrude Mode]] --><br>"\ "<p><img source=\" toolsExtrudeAction\"><br> "\ "Activates <b>Extrude</b> mode, allowing you to create a rod or ring using a chunk as "\ "a repeating unit.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsExtrudeAction", self. toolsExtrudeAction.iconSet().pixmap() ) self. toolsExtrudeAction.setWhatsThis( toolsExtrudeActionText ) #### Fuse Chunks Tool #### toolsFuseChunksActionText = "<u><b>Fuse Chunks Tool</b></u><!-- [[Feature:Fuse Chunks Mode]] --><br>"\ "<p><img source=\" toolsFuseChunksAction\"><br> "\ "<b>Fuse Chunks</b> creates bonds between two or more chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseChunksAction", self. toolsFuseChunksAction.iconSet().pixmap() ) self.toolsFuseChunksAction.setWhatsThis( toolsFuseChunksActionText ) #### Fuse Atoms Tool #### toolsFuseAtomsActionText = "<u><b>Fuse Atoms Tool</b></u><!-- [[Feature:Fuse Atoms Mode]] (nim?) --><br>"\ "<p><img source=\" toolsFuseAtomsAction\"><br> "\ "<b>Fuse Atoms</b> fuses the overlapping atoms between two or more chunks.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsFuseAtomsAction", self. toolsFuseAtomsAction.iconSet().pixmap() ) self.toolsFuseAtomsAction.setWhatsThis( toolsFuseAtomsActionText ) #### Movie Player #### simMoviePlayerActionText = "<u><b>Movie Player</b></u><br>"\ "<p><img source=\" simMoviePlayerAction\"><br> "\ "Plays the most recent trajectory (movie) file created by the <b>Simulator</b>.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simMoviePlayerAction", self. simMoviePlayerAction.iconSet().pixmap() ) self. simMoviePlayerAction.setWhatsThis( simMoviePlayerActionText ) #### Simulator #### simSetupActionText = "<u><b>Simulator</b></u><br>"\ "<p><img source=\" simSetupAction\"><br> "\ "Creates a trajectory (movie) file by calculating the inter-atomic potentials and bonding "\ "of the entire model. The user determines the number of frames in the movie, the time step, "\ "and the temperature for the simulation.</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simSetupAction", self. simSetupAction.iconSet().pixmap() ) self. simSetupAction.setWhatsThis( simSetupActionText ) #### Plot Tool #### simPlotToolActionText = "<u><b>Plot Tool</b></u><br>"\ "<p><img source=\" simPlotToolAction\"><br> "\ "Plots a simulator trace file using GNUplot. A simulation must be run to create "\ "the trace file, and the part must have a jig that writes output to the trace file. <br><br>"\ "The following list of jigs write data to the trace file:<br>"\ "<b>Rotary Motors:</b> speed (GHz) and torque (nn-nm)<br>"\ "<b>Linear Motors:</b> displacement (pm)<br>"\ "<b>Anchors:</b> torque (nn-nm)<br>"\ "<b>Thermostats:</b> energy added (zJ)<br>"\ "<b>Thermometer:</b> temperature (K)<br>"\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " simPlotToolAction", self. simPlotToolAction.iconSet().pixmap() ) self. simPlotToolAction.setWhatsThis( simPlotToolActionText ) ############################################## # Dashboard Buttons ############################################## #### Done #### toolsDoneActionText = "<u><b>Done</b></u><br>"\ "<p><img source=\" toolsDoneAction\"><br> "\ "Completes the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsDoneAction", self. toolsDoneAction.iconSet().pixmap() ) self. toolsDoneAction.setWhatsThis( toolsDoneActionText ) #### Cancel #### toolsCancelActionText = "<u><b>Cancel</b></u><br>"\ "<p><img source=\" toolsCancelAction\"><br> "\ "Cancels the current operation and enters Select Chunks mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsCancelAction", self.toolsCancelAction.iconSet().pixmap() ) self. toolsCancelAction.setWhatsThis( toolsCancelActionText ) #### Back up #### toolsBackUpActionText = "<u><b>Back Up</b></u><br>"\ "<p><img source=\" toolsBackUpAction\"><br> "\ "Undoes the previous operation."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( " toolsBackUpAction", self.toolsBackUpAction.iconSet().pixmap() ) self. toolsBackUpAction.setWhatsThis( toolsBackUpActionText ) #### Start Over #### toolsStartOverActionText = "<u><b>Start Over</b></u><br>"\ "<p><img source=\"toolsStartOverAction\"><br> "\ "Cancels the current operation, leaving the user in the current mode."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "toolsStartOverAction", self.toolsStartOverAction.iconSet().pixmap() ) self.toolsStartOverAction.setWhatsThis(toolsStartOverActionText ) #### Add Layers #### ccAddLayerActionText = "<u><b>Add Layer</b></u><br>"\ "<p><img source=\"ccAddLayerAction\"><br> "\ "Adds a new layer of diamond lattice to the existing layer.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "ccAddLayerAction", self.ccAddLayerAction.iconSet().pixmap() ) self.ccAddLayerAction.setWhatsThis(ccAddLayerActionText ) ############################################## # Jigs ############################################## #### Anchor #### jigsAnchorActionText = "<u><b>Anchor</b></u><br>"\ "<p><img source=\"jigsAnchorAction\"><br> "\ "Attaches a <b>Anchor</b> to the selected atom(s), which "\ "constrains its motion during a minimization or simulation.</p>"\ "<p>To create an Anchor, enter <b>Select Atoms</b> mode, "\ "select the atom(s) you want to anchor and then select this action. "\ "Anchors are drawn as a black wireframe box around each selected atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsAnchorAction", self.jigsAnchorAction.iconSet().pixmap() ) self.jigsAnchorAction.setWhatsThis(jigsAnchorActionText ) #### Rotary Motor #### jigsMotorActionText = "<u><b>Rotary Motor</b></u><br>"\ "<p><img source=\"jigsMotorAction\"><br> "\ "Attaches a <b>Rotary Motor</b> to the selected atoms. The Rotary Motor is used by "\ "the simulator to apply rotary motion to a set of atoms during a simulation run. You may "\ "specify the <b>torque (in nN*nm)</b> and <b>speed (in Ghz)</b> of the motor.</p>"\ "<p>To create a Rotary Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsMotorAction", self.jigsMotorAction.iconSet().pixmap() ) self.jigsMotorAction.setWhatsThis(jigsMotorActionText ) #### Linear Motor #### jigsLinearMotorActionText = "<u><b>Linear Motor</b></u><br>"\ "<p><img source=\"jigsLinearMotorAction\"><br> "\ "Attaches a <b>Linear Motor</b> to the selected atoms. The Linear Motor is used by "\ "the simulator to apply linear motion to a set of atoms during a simulation run. You may "\ "specify the <b>force (in nN*nm)</b> and <b>stiffness (in N/m)</b> of the motor.</p>"\ "<p>To create a Linear Motor, enter <b>Select Atoms</b> mode, "\ "select the atoms you want to attach the motor to and then select this action.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsLinearMotorAction", self.jigsLinearMotorAction.iconSet().pixmap() ) self.jigsLinearMotorAction.setWhatsThis(jigsLinearMotorActionText ) #### Thermostat #### jigsStatActionText = "<u><b>Thermostat</b></u><br>"\ "<p><img source=\"jigsStatAction\"><br> "\ "Attaches a <b>Langevin Thermostat</b> to a single selected atom, thereby associating "\ "the themostat to the entire molecule of which the selected atom is a member. The user "\ "specifies the temperature (in Kelvin).</p>"\ "<p>The Langevin Thermostat is used to set and hold the temperature "\ "of a molecule during a simulation run.</p>"\ "<p>To create a Langevin Thermostat, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermostat is drawn as a "\ "blue wireframe box around the selected atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsStatAction", self.jigsStatAction.iconSet().pixmap() ) self.jigsStatAction.setWhatsThis(jigsStatActionText ) #### Thermometer #### jigsThermoActionText = "<u><b>Thermometer</b></u><br>"\ "<p><img source=\"jigsThermoAction\"><br> "\ "Attaches a <b>Thermometer</b> to a single selected atom, thereby associating "\ "the themometer to the entire molecule of which the selected atom is a member. "\ "<p>The temperature of the molecule will be recorded and written to a trace file "\ "during a simulation run.</p>"\ "<p>To create a Thermometer, enter <b>Select Atoms</b> mode, "\ "select a single atom and then select this action. The thermometer is drawn as a "\ "dark red wireframe box around the selected atom.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "jigsThermoAction", self.jigsThermoAction.iconSet().pixmap() ) self.jigsThermoAction.setWhatsThis(jigsThermoActionText ) ############################################## # Display ############################################## #### Display Object Color #### dispObjectColorActionText = "<u><b>Object Color</b></u><br>"\ "<p><img source=\"dispObjectColorAction\"><br> "\ "Allows you to change the color of the selected object(s).</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispObjectColorAction", self.dispObjectColorAction.iconSet().pixmap() ) self.dispObjectColorAction.setWhatsThis(dispObjectColorActionText ) #### Display Background Color #### dispBGColorActionText = "<u><b>Background Color</b></u><br>"\ "<p><img source=\"dispBGColorAction\"><br> "\ "Allows you to change the background color of the main window.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispBGColorAction", self.dispBGColorAction.iconSet().pixmap() ) self.dispBGColorAction.setWhatsThis(dispBGColorActionText ) ############################################## # Help Toolbar ############################################## #### What's This #### helpWhatsThisText = "<u><b>What's This</b></u><br>"\ "<p><img source=\"helpWhatsThis\"><br> "\ "Click this option to invoke a small question mark that is attached to the mouse pointer. "\ "Click on a feature which you would like more information about. "\ "A popup box appears with information about the feature.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "helpWhatsThis", self.helpWhatsThisAction.iconSet().pixmap() ) self.helpWhatsThisAction.setWhatsThis( helpWhatsThisText ) ############################################## # Datum Display Toolbar ############################################## #### Display Trihedron #### dispTrihedronText = "<u><b>Display Trihedron</b></u><br>"\ "<p><img source=\"dispTrihedron\"><br> "\ "Toggles the trihedron on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispTrihedron", self.dispTrihedronAction.iconSet().pixmap() ) self.dispTrihedronAction.setWhatsThis(dispTrihedronText ) #### Display Csys #### dispCsysText = "<u><b>Display Csys Axis</b></u><br>"\ "<p><img source=\"dispCsys\"><br> "\ "Toggles the coordinate system axis on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispCsys", self.dispCsysAction.iconSet().pixmap() ) self.dispCsysAction.setWhatsThis(dispCsysText ) #### Display Datum Lines #### dispDatumLinesText = "<u><b>Display Datum Lines</b></u><br>"\ "<p><img source=\"dispDatumLines\"><br> "\ "Toggles Datum Lines on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumLines", self.dispDatumLinesAction.iconSet().pixmap() ) self.dispDatumLinesAction.setWhatsThis(dispDatumLinesText ) #### Display Datum Planes #### dispDatumPlanesText = "<u><b>Display Datum Planes</b></u><br>"\ "<p><img source=\"dispDatumPlanes\"><br> "\ "Toggles Datum Planes on and off.</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispDatumPlanes", self.dispDatumPlanesAction.iconSet().pixmap() ) self.dispDatumPlanesAction.setWhatsThis(dispDatumPlanesText ) #### Display Grid #### dispGridText = "<u><b>Display 3-D Grid</b></u><br>"\ "<p><img source=\"dispGrid\"><br> "\ "Toggles the 3-D grid on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispGrid", self.dispGridAction.iconSet().pixmap() ) self.dispGridAction.setWhatsThis(dispGridText ) #### Display Open Bonds #### dispOpenBondsText = "<u><b>Display Singlets</b></u><br>"\ "<p><img source=\"dispOpenBonds\"><br> "\ "Toggles Singlets on and off."\ "</p>" QMimeSourceFactory.defaultFactory().setPixmap( "dispOpenBonds", self.dispOpenBondsAction.iconSet().pixmap() ) self.dispOpenBondsAction.setWhatsThis(dispOpenBondsText ) | 96ff78d555697c46c826ca601d43f083f34140a8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/96ff78d555697c46c826ca601d43f083f34140a8/whatsthis.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
2888,
2323,
2503,
12,
2890,
4672,
225,
19709,
26487,
7,
468,
1387,
13288,
3215,
19709,
26487,
7,
225,
11849,
7,
3502,
1387,
11849,
7,
225,
585,
3678,
1528,
273,
3532,
89,
4438,
70,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2888,
2323,
2503,
12,
2890,
4672,
225,
19709,
26487,
7,
468,
1387,
13288,
3215,
19709,
26487,
7,
225,
11849,
7,
3502,
1387,
11849,
7,
225,
585,
3678,
1528,
273,
3532,
89,
4438,
70,
... |
LOG('MailBoxer', INFO, 'stripped, but not archiving attachment %s %s. Appeared to be part of an HTML message.' % (attachment['filename'], attachment['maintype'])) | m = '%s (%s): stripped, but not archiving %s attachment '\ '%s; it appears to be part of an HTML message.' % \ (self.getProperty('title'), self.getId(), attachment['maintype'], attachment['filename']) log.info(m) | def manage_addMail(self, msg): """ Store mail & attachments in a folder and return it. """ archive = self.restrictedTraverse(self.getValueFor('storage'), default=None) if archive: mailObject = self._create_mailObject(msg, archive) ids = [] for attachment in msg.attachments: if attachment['filename'] == '' and attachment['subtype'] == 'plain': # We definately don't want to save the plain text body again! pass elif attachment['filename'] == '' and attachment['subtype'] == 'html': # We might want to do something with the HTML body some day LOG('MailBoxer', INFO, 'stripped, but not archiving attachment %s %s. Appeared to be part of an HTML message.' % (attachment['filename'], attachment['maintype'])) elif attachment['contentid']: LOG('MailBoxer', INFO, 'stripped, but not archiving attachment %s %s. Appeared to be part of an HTML message.' % (attachment['filename'], attachment['maintype'])) else: LOG('MailBoxer', INFO, 'stripped and archiving attachment %s %s' % (attachment['filename'], attachment['maintype'])) if archive: id = self.addMailBoxerFile(mailObject, None, attachment['filename'], attachment['payload'], attachment['mimetype']) else: id = self.addGSFile(attachment['filename'], msg.subject, msg.sender_id, attachment['payload'], attachment['mimetype']) ids.append(id) if archive and ids: mailObject.manage_addProperty('x-xwfnotification-file-id', ' '.join(ids), 'ustring') mailObject.manage_addProperty('x-xwfnotification-message-length', len(msg.body.replace('\r', '')), 'ustring') | 022876f88e927316bd924ded9b9dc1cbc88f4167 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6274/022876f88e927316bd924ded9b9dc1cbc88f4167/XWFMailingList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1289,
6759,
12,
2890,
16,
1234,
4672,
3536,
4994,
4791,
473,
10065,
316,
279,
3009,
471,
327,
518,
18,
225,
3536,
5052,
273,
365,
18,
29306,
29654,
12,
2890,
18,
24805,
1290,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10680,
67,
1289,
6759,
12,
2890,
16,
1234,
4672,
3536,
4994,
4791,
473,
10065,
316,
279,
3009,
471,
327,
518,
18,
225,
3536,
5052,
273,
365,
18,
29306,
29654,
12,
2890,
18,
24805,
1290,
... |
def delSliders(self): self.valFiltHigh = self.slideHigh.val self.valFiltLow = self.slideLow.val try: self.fig.delaxes(self.axHighpass) self.fig.delaxes(self.axLowpass) except: return def addSliders(self): self.axHighpass = self.fig.add_axes([0.63, 0.05, 0.30, 0.03], xscale='log') self.axLowpass = self.fig.add_axes([0.63, 0.10, 0.30, 0.03], xscale='log') minimum = 1.0/ (self.streams[self.stPt][0].stats.npts/float(self.streams[self.stPt][0].stats.sampling_rate)) maximum = self.streams[self.stPt][0].stats.sampling_rate/2.0 self.valFiltHigh = max(minimum,self.valFiltHigh) self.valFiltLow = min(maximum,self.valFiltLow) self.slideHigh = Slider(self.axHighpass, 'Highpass', minimum, maximum, valinit=self.valFiltHigh, facecolor='lightgrey', edgecolor='k', linewidth=1.7) self.slideLow = Slider(self.axLowpass, 'Lowpass', minimum, maximum, valinit=self.valFiltLow, facecolor='lightgrey', edgecolor='k', linewidth=1.7) self.slideHigh.on_changed(self.updateLow) self.slideLow.on_changed(self.updateHigh) | def delSliders(self): self.valFiltHigh = self.slideHigh.val self.valFiltLow = self.slideLow.val try: self.fig.delaxes(self.axHighpass) self.fig.delaxes(self.axLowpass) except: return | b822b77814749ba0fa0b0a638d2c2e8ccf514f6c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/b822b77814749ba0fa0b0a638d2c2e8ccf514f6c/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
3738,
24290,
12,
2890,
4672,
365,
18,
1125,
42,
4526,
8573,
273,
365,
18,
26371,
8573,
18,
1125,
365,
18,
1125,
42,
4526,
10520,
273,
365,
18,
26371,
10520,
18,
1125,
775,
30,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
3738,
24290,
12,
2890,
4672,
365,
18,
1125,
42,
4526,
8573,
273,
365,
18,
26371,
8573,
18,
1125,
365,
18,
1125,
42,
4526,
10520,
273,
365,
18,
26371,
10520,
18,
1125,
775,
30,
36... | |
refList = Ovf.getDict(references, None)['children'] diskList = Ovf.getDict(diskSection, None)['children'] | refList = Ovf.getDict(references)['children'] diskList = Ovf.getDict(diskSection)['children'] | def cleanupExtraDiskImages(dir, references, diskSection, configId=None): """ Check if any image file is referred more than once, and remove extra copies @param dir: directory path to Ovf file/disk image files @type dir: String @param configId: configuration name @type configId: String """ # Get file list from References and list of disks from DiskSection refList = Ovf.getDict(references, None)['children'] diskList = Ovf.getDict(diskSection, None)['children'] # Clean up image files referred more than once for file in refList: fileId = file['ovf:id'] source = os.path.join(dir, file['ovf:href']) fileRefCnt = 0 prefCnt = 0 for disk in diskList: if disk.has_key('ovf:fileRef'): if disk['ovf:fileRef'] == fileId: fileRefCnt = fileRefCnt + 1 if disk.has_key('ovf:parentRef'): if disk['ovf:parentRef'] == fileId: prefCnt = prefCnt + 1 if fileRefCnt >= 2 or prefCnt >= 2: if os.path.isfile(source): os.remove(source) | b11918c759c74ee67c3db3b2d51ef80c2e83e7eb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9789/b11918c759c74ee67c3db3b2d51ef80c2e83e7eb/OvfLibvirt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6686,
7800,
6247,
8946,
12,
1214,
16,
5351,
16,
4234,
5285,
16,
642,
548,
33,
7036,
4672,
3536,
2073,
309,
1281,
1316,
585,
353,
29230,
1898,
2353,
3647,
16,
471,
1206,
2870,
13200,
225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6686,
7800,
6247,
8946,
12,
1214,
16,
5351,
16,
4234,
5285,
16,
642,
548,
33,
7036,
4672,
3536,
2073,
309,
1281,
1316,
585,
353,
29230,
1898,
2353,
3647,
16,
471,
1206,
2870,
13200,
225,... |
return cls.query_objects(filter_data).count() | query = cls.query_objects(filter_data, initial_query=initial_query) return query.count() | def query_count(cls, filter_data): """\ Like query_objects, but retreive only the count of results. """ filter_data.pop('query_start', None) filter_data.pop('query_limit', None) return cls.query_objects(filter_data).count() | d4f598c0d25beef0d9b9a12ae00304a4088895f5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/d4f598c0d25beef0d9b9a12ae00304a4088895f5/model_logic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
67,
1883,
12,
6429,
16,
1034,
67,
892,
4672,
3536,
64,
23078,
843,
67,
6911,
16,
1496,
325,
266,
688,
1338,
326,
1056,
434,
1686,
18,
3536,
1034,
67,
892,
18,
5120,
2668,
2271,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
843,
67,
1883,
12,
6429,
16,
1034,
67,
892,
4672,
3536,
64,
23078,
843,
67,
6911,
16,
1496,
325,
266,
688,
1338,
326,
1056,
434,
1686,
18,
3536,
1034,
67,
892,
18,
5120,
2668,
2271,
... |
stat_pos = PositionLabel(sb1, name = 'position', text = '', anchor = 'center', width=20, updatecb = canvas.GetCurrentPos) stat_pos.pack(side = LEFT, fill = X) | stat_pos = PositionLabel(sb1, name='position', text='', anchor='center', width=20, updatecb=canvas.GetCurrentPos) stat_pos.pack(side=LEFT, fill=X) | def build_status_bar(self): status_bar = self.status_bar canvas = self.canvas | 5bd05aab08ecc99debb8be46af1003105e4183ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3123/5bd05aab08ecc99debb8be46af1003105e4183ab/mainwindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2327,
67,
3215,
12,
2890,
4672,
1267,
67,
3215,
273,
365,
18,
2327,
67,
3215,
5953,
273,
365,
18,
15424,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
2327,
67,
3215,
12,
2890,
4672,
1267,
67,
3215,
273,
365,
18,
2327,
67,
3215,
5953,
273,
365,
18,
15424,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
'no-scan'']) | 'no-scan']) | def main(argv): """ The main daemon program. Keyword arguments: argv -- The arguments passed to the script. """ global child_pid do_daemonize = True redirect_stderr = True redirect_stdout = True auto_scan = True try: opts, args = getopt.getopt(sys.argv[1:], 'fenosP:', ['help', 'no-daemon', 'no-poll', 'no-stderr', 'no-stdout', 'no-scan'']) except getopt.GetoptError: # Print help information and exit usage() sys.exit(2) no_poll = False for o, a in opts: if o in ('-h', '--help'): usage() sys.exit() if o in ('-e', '--no-stderr'): redirect_stderr = False if o in ('-o', '--no-stdout'): redirect_stdout = False if o in ('-f', '--no-daemon'): do_daemonize = False if o in ('-s', '--no-scan'): auto_scan = False if o in ('-n', '--no-poll'): no_poll = True if do_daemonize: daemonize() if redirect_stderr or redirect_stdout: output = LogWriter() if redirect_stdout: sys.stdout = output if redirect_stderr: sys.stderr = output time.sleep(1) print '---------------------------' print 'wicd initializing...' print '---------------------------' # Open the DBUS session d_bus_name = dbus.service.BusName('org.wicd.daemon', bus=dbus.SystemBus()) obj = ConnectionWizard(d_bus_name, auto_connect=auto_scan) gobject.threads_init() if not no_poll: (child_pid, x, x, x) = gobject.spawn_async([wpath.bin + "monitor.py"], flags=gobject.SPAWN_CHILD_INHERITS_STDIN) signal.signal(signal.SIGTERM, sigterm_caught) # Enter the main loop mainloop = gobject.MainLoop() mainloop.run() | 74925eaf8077cc70ef48056a2eb635fd20f392bb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/353/74925eaf8077cc70ef48056a2eb635fd20f392bb/daemon.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
19485,
4672,
3536,
1021,
2774,
8131,
5402,
18,
225,
18317,
1775,
30,
5261,
1493,
1021,
1775,
2275,
358,
326,
2728,
18,
225,
3536,
2552,
1151,
67,
6610,
741,
67,
21511,
554,
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,
2774,
12,
19485,
4672,
3536,
1021,
2774,
8131,
5402,
18,
225,
18317,
1775,
30,
5261,
1493,
1021,
1775,
2275,
358,
326,
2728,
18,
225,
3536,
2552,
1151,
67,
6610,
741,
67,
21511,
554,
273... |
(TroveTroves.flags & %d) == 0 | (TroveTroves.flags & %d) = 0 | def getTrove(cu, roleIds, name, version, flavor, mkUrl = None, thisHost = None): cu.execute(""" SELECT Instances.instanceId FROM Instances JOIN Items USING (itemId) JOIN Versions ON (Instances.versionId = Versions.versionId) JOIN Flavors ON (Instances.flavorId = Flavors.flavorId) JOIN UserGroupInstancesCache AS ugi ON (instances.instanceId = ugi.instanceId AND ugi.userGroupId in (%s)) WHERE item = ? AND version = ? AND flavor = ? """ % ",".join( str(x) for x in roleIds), name, version, deps.parseFlavor(flavor).freeze()) l = [ x[0] for x in cu ] if not l: return None instanceId = l[0] cu.execute(""" SELECT infoType, data FROM TroveInfo WHERE instanceId = ? AND infoType IN (%s) """ % ",".join(str(x) for x in (trove._TROVEINFO_TAG_SOURCENAME, trove._TROVEINFO_TAG_CLONEDFROM, trove._TROVEINFO_TAG_CLONEDFROMLIST, trove._TROVEINFO_TAG_BUILDTIME, trove._TROVEINFO_TAG_SIZE, )), instanceId) troveInfo = dict( (x[0], trove.TroveInfo.streamDict[x[0]][1](x[1])) for x in cu ) kwargs = { 'name' : name, 'version' : versions.VersionFromString(version), 'flavor' : flavor, 'buildtime' : int(troveInfo[trove._TROVEINFO_TAG_BUILDTIME]()) } if trove._TROVEINFO_TAG_SOURCENAME in troveInfo: kwargs['source'] = datamodel.BaseTroveInfo( name = troveInfo[trove._TROVEINFO_TAG_SOURCENAME](), version = versions.VersionFromString(version).getSourceVersion(), flavor = '', mkUrl = mkUrl) if trove._TROVEINFO_TAG_SIZE in troveInfo: kwargs['size'] = troveInfo[trove._TROVEINFO_TAG_SIZE]() t = datamodel.SingleTrove(mkUrl = mkUrl, **kwargs) if trove._TROVEINFO_TAG_CLONEDFROMLIST in troveInfo: clonedFromList = troveInfo[trove._TROVEINFO_TAG_CLONEDFROMLIST] elif (trove._TROVEINFO_TAG_CLONEDFROM in troveInfo): clonedFromList = [ troveInfo[trove._TROVEINFO_TAG_CLONEDFROM]() ] else: clonedFromList = [] for ver in clonedFromList: t.addClonedFrom(name, ver, flavor, mkUrl = mkUrl) cu.execute(""" SELECT dirName, basename, version, pathId, fileId FROM TroveFiles JOIN Versions USING (versionId) JOIN FileStreams ON (TroveFiles.streamId = FileStreams.streamId) JOIN FilePaths ON (TroveFiles.filePathId = FilePaths.filePathId) JOIN DirNames ON (FilePaths.dirNameId = DirNames.dirNameId) JOIN Basenames ON (FilePaths.baseNameId = Basenames.baseNameId) WHERE TroveFiles.instanceId = ? ORDER BY dirName, basename """, instanceId) for (dirName, baseName, fileVersion, pathId, fileId) in cu: fileObj = datamodel.FileReference( path = dirName + '/' + baseName, version = fileVersion, pathId = md5ToString(cu.frombinary(pathId)), fileId = sha1ToString(cu.frombinary(fileId)), mkUrl = mkUrl, thisHost = thisHost) t.addFile(fileObj) cu.execute(""" SELECT item, version, flavor FROM TroveTroves JOIN Instances ON (Instances.instanceId = TroveTroves.includedId) JOIN Items USING (itemId) JOIN Versions ON (Versions.versionId = Instances.versionId) JOIN Flavors ON (Flavors.flavorId = Instances.flavorId) WHERE TroveTroves.instanceId = ? AND (TroveTroves.flags & %d) == 0 ORDER BY item, version, flavor """ % schema.TROVE_TROVES_WEAKREF, instanceId) for (subName, subVersion, subFlavor) in cu: subFlavor = str(deps.ThawFlavor(subFlavor)) t.addReferencedTrove(subName, versions.VersionFromString(subVersion), subFlavor, mkUrl = mkUrl) return t | 6b71ee1c3dd15b9d027312ce72de6a987baf70b9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7641/6b71ee1c3dd15b9d027312ce72de6a987baf70b9/repquery.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3181,
303,
537,
12,
6319,
16,
2478,
2673,
16,
508,
16,
1177,
16,
19496,
16,
5028,
1489,
273,
599,
16,
333,
2594,
273,
599,
4672,
15985,
18,
8837,
2932,
3660,
9111,
18357,
18,
1336,
548... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3181,
303,
537,
12,
6319,
16,
2478,
2673,
16,
508,
16,
1177,
16,
19496,
16,
5028,
1489,
273,
599,
16,
333,
2594,
273,
599,
4672,
15985,
18,
8837,
2932,
3660,
9111,
18357,
18,
1336,
548... |
print "__CALL__" | def __call__(self): #needed by configlist print "__CALL__" value = "" mPos = self.markedPos print mPos for i in self.parent.value: if value != "": #fixme no heading separator possible value += self.parent.vals[0] if mPos >= len(value) - 1: mPos += 1 diff = self.parent.vals[1] - len(str(i)) if diff > 0: #how about alignment? value += " "[0:diff] #how is this done correct? value += str(i) value = value[0:mPos] + "_" + value[mPos + 1:] return ("text", value) | bb3620cbe20ad4a79e40efbd81e483fa2819762b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/bb3620cbe20ad4a79e40efbd81e483fa2819762b/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
1082,
202,
7,
17471,
635,
642,
1098,
460,
273,
1408,
312,
1616,
273,
365,
18,
3355,
329,
1616,
1172,
312,
1616,
364,
277,
316,
365,
18,
2938,
18,
1132,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
1082,
202,
7,
17471,
635,
642,
1098,
460,
273,
1408,
312,
1616,
273,
365,
18,
3355,
329,
1616,
1172,
312,
1616,
364,
277,
316,
365,
18,
2938,
18,
1132,... | |
server = SimpleXMLRPCServer(("localhost", 8000), MathHandler) | server = MathServer(("localhost", 8000)) | def export_add(self, x, y): return x + y | eca2f3e72cc54be7e8c786d52d54714d73e4aef8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/eca2f3e72cc54be7e8c786d52d54714d73e4aef8/SimpleXMLRPCServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
1289,
12,
2890,
16,
619,
16,
677,
4672,
327,
619,
397,
677,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3359,
67,
1289,
12,
2890,
16,
619,
16,
677,
4672,
327,
619,
397,
677,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
return http.Response(stream=message(invalid_confirm_key, '/register')) | return HTMLResponse(stream=message(invalid_confirm_key, '/register')) | def render(self, request): if not notebook.conf()['email']: return http.Response(stream=message('The confirmation system is not active.')) key = request.args['key'][0] invalid_confirm_key = """\ | 86a4ed9cb0aba48a11523b820246bf1c9d9e7be2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/86a4ed9cb0aba48a11523b820246bf1c9d9e7be2/twist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
590,
4672,
309,
486,
14718,
18,
3923,
1435,
3292,
3652,
3546,
30,
327,
1062,
18,
1064,
12,
3256,
33,
2150,
2668,
1986,
14296,
2619,
353,
486,
2695,
1093,
3719,
498,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
12,
2890,
16,
590,
4672,
309,
486,
14718,
18,
3923,
1435,
3292,
3652,
3546,
30,
327,
1062,
18,
1064,
12,
3256,
33,
2150,
2668,
1986,
14296,
2619,
353,
486,
2695,
1093,
3719,
498,
... |
self.assertEqual(Counter(iter(actual_seq)), Counter(iter(expected_seq))) | self.assertEqual(Counter(actual_seq), Counter(expected_seq)) | def assertCountEqual(self, actual_seq, expected_seq, msg=None): """An unordered sequence specific comparison. It asserts that actual_seq and expected_seq have the same element counts. Equivalent to:: | a070c8fe77663ed0a13fa349b2a7094267f195c3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/a070c8fe77663ed0a13fa349b2a7094267f195c3/case.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
1380,
5812,
12,
2890,
16,
3214,
67,
5436,
16,
2665,
67,
5436,
16,
1234,
33,
7036,
4672,
3536,
979,
29573,
3102,
2923,
5826,
18,
2597,
26124,
716,
3214,
67,
5436,
471,
2665,
67,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1815,
1380,
5812,
12,
2890,
16,
3214,
67,
5436,
16,
2665,
67,
5436,
16,
1234,
33,
7036,
4672,
3536,
979,
29573,
3102,
2923,
5826,
18,
2597,
26124,
716,
3214,
67,
5436,
471,
2665,
67,
5... |
self.assertTrue(value % 'test experiment' in str(f['title']), str(f['title'])) self.assertTrue(value % 'some university' in str(f['institution_name'])) | self.assertTrue(value % 'test experiment' in str(f['title']), str(f['title'])) self.assertTrue(value % 'some university' in str(f['institution_name'])) | def test_instance(self): from tardis.tardis_portal import forms from tardis.tardis_portal import models exp = self._create_experiment() f = forms.FullExperiment(instance=exp) value = "value=\"%s\"" text_area = ">%s</textarea>" self.assertTrue(value % 'test experiment' in str(f['title']), str(f['title'])) self.assertTrue(value % 'some university' in str(f['institution_name'])) self.assertTrue('selected="selected">tardis_user1</option>' in str(f['created_by'])) self.assertTrue(text_area % "first one" in str(f['dataset_description[0]'])) self.assertTrue(text_area % "second" in str(f['dataset_description[1]'])) self.assertTrue(value % "another.py" in str(f['file[0]']), str(f['file[0]'])) self.assertTrue(value % "file.py" in str(f['file[1]']), str(f['file[1]'])) self.assertTrue(value % "file1.py" in str(f['file[1]']), str(f['file[1]'])) | e337f225828ef0ea0deed4095e6eff02ca3384fb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11933/e337f225828ef0ea0deed4095e6eff02ca3384fb/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1336,
12,
2890,
4672,
628,
268,
1060,
291,
18,
88,
1060,
291,
67,
24386,
1930,
10138,
628,
268,
1060,
291,
18,
88,
1060,
291,
67,
24386,
1930,
3679,
1329,
273,
365,
6315,
264... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1336,
12,
2890,
4672,
628,
268,
1060,
291,
18,
88,
1060,
291,
67,
24386,
1930,
10138,
628,
268,
1060,
291,
18,
88,
1060,
291,
67,
24386,
1930,
3679,
1329,
273,
365,
6315,
264... |
package, self, | package, self, | def bundle_requirements(self): for dest_dir in self._bundle_editable_dirs: package = os.path.basename(dest_dir) ## FIXME: svnism: for vcs_backend in vcs.backends: url = rev = None vcs_bundle_file = os.path.join( dest_dir, vcs_backend.bundle_file) if os.path.exists(vcs_bundle_file): vc_type = vcs_backend.name fp = open(vcs_bundle_file) content = fp.read() fp.close() url, rev = vcs_backend().parse_vcs_bundle_file(content) break if url: url = '%s+%s@%s' % (vc_type, url, rev) else: url = None yield InstallRequirement( package, self, editable=True, url=url, update=False, source_dir=dest_dir) for dest_dir in self._bundle_build_dirs: package = os.path.basename(dest_dir) yield InstallRequirement( package, self, source_dir=dest_dir) | 87e0e74f63ca00031b2f851d4ce7e8f1d0f986bb /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12982/87e0e74f63ca00031b2f851d4ce7e8f1d0f986bb/pip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3440,
67,
16175,
12,
2890,
4672,
364,
1570,
67,
1214,
316,
365,
6315,
9991,
67,
19653,
67,
8291,
30,
2181,
273,
1140,
18,
803,
18,
13909,
12,
10488,
67,
1214,
13,
7541,
9852,
30,
5893,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3440,
67,
16175,
12,
2890,
4672,
364,
1570,
67,
1214,
316,
365,
6315,
9991,
67,
19653,
67,
8291,
30,
2181,
273,
1140,
18,
803,
18,
13909,
12,
10488,
67,
1214,
13,
7541,
9852,
30,
5893,... |
main(); | main() | def main(): Comm = Epetra.PyComm(); args = sys.argv[1:] if len(args) == 0: Type = "Amesos_Lapack" else: Type = args[0]; NumGlobalRows = 10; Map = Epetra.Map(NumGlobalRows, 0, Comm); LHS_exact = Epetra.MultiVector(Map, 1); LHS = Epetra.MultiVector(Map, 1); RHS = Epetra.MultiVector(Map, 1); Matrix = Epetra.CrsMatrix(Epetra.Copy, Map, 0); Indices = Epetra.IntSerialDenseVector(3); Values = Epetra.SerialDenseVector(3); Values[0] = 2.0; Values[1] = -1.0; Values[2] = -1.0; NumLocalRows = Map.NumMyElements() # Builds the matrix (1D Laplacian) for ii in range(0, NumLocalRows): i = Map.GID(ii) Indices[0] = i; if i == 0: NumEntries = 2; Indices[1] = i + 1; elif i == NumGlobalRows - 1: NumEntries = 2; Indices[1] = i - 1; else: NumEntries = 3; Indices[1] = i - 1; Indices[2] = i + 1; Matrix.InsertGlobalValues(i, NumEntries, Values, Indices); ierr = Matrix.FillComplete(); LHS_exact.Random(); Matrix.Multiply(False, LHS_exact, RHS); LHS.PutScalar(1.0); Problem = Epetra.LinearProblem(Matrix, LHS, RHS); if Type == "Amesos_Lapack": Solver = Amesos.Lapack(Problem); elif Type == "Amesos_Klu": Solver = Amesos.Klu(Problem); elif Type == "Amesos_Umfpack": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Pardiso": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Taucs": Solver = Amesos.Umfpack(Problem); elif Type == "Amesos_Superlu": Solver = Amesos.Superlu(Problem); elif Type == "Amesos_Superludist": Solver = Amesos.Superludist(Problem); elif Type == "Amesos_Dscpack": Solver = Amesos.Dscpack(Problem); elif Type == "Amesos_Mumps": Solver = Amesos.Mumps(Problem); else: print 'Selected solver (%s) not available' % Type PrintHelp(); sys.exit(-2); AmesosList = { "PrintStatus": True, "PrintTiming": True }; Solver.SetParameters(AmesosList); Solver.SymbolicFactorization(); Solver.NumericFactorization(); ierr = Solver.Solve(); print "Solver.Solve() return code = ", ierr del Solver | b0de99b594baede77af9aff7c1b994a5d198a226 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1130/b0de99b594baede77af9aff7c1b994a5d198a226/exSolvers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
16854,
273,
512,
6951,
354,
18,
9413,
12136,
5621,
225,
833,
273,
2589,
18,
19485,
63,
21,
26894,
309,
562,
12,
1968,
13,
422,
374,
30,
1412,
273,
315,
9864,
281,
538,
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,
2774,
13332,
16854,
273,
512,
6951,
354,
18,
9413,
12136,
5621,
225,
833,
273,
2589,
18,
19485,
63,
21,
26894,
309,
562,
12,
1968,
13,
422,
374,
30,
1412,
273,
315,
9864,
281,
538,
67,... |
cmd = 'convert %s -flatten -coalesce -strip %s.png' % (img_path, img_path) | cmd = ["convert", img_path, "-flatten", "-coalesce", "-strip", img_path+".png"] | def svg2png(self, img_path ): cmd = 'convert %s -flatten -coalesce -strip %s.png' % (img_path, img_path) try: p = subprocess.Popen(cmd, shell=True) pid, status = os.waitpid(p.pid, 0) if status != 0 : log.warning('img could not be converted. convert exited with non-zero return code:', repr(cmd)) return '' else: return '%s.png' % img_path except OSError: log.warning('img could not be converted. cmd failed:', repr(cmd)) return '' | 21ad34a04bb7dd9bdcbf6b924b3340b8a8c4a2e3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12390/21ad34a04bb7dd9bdcbf6b924b3340b8a8c4a2e3/rlwriter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9804,
22,
6446,
12,
2890,
16,
3774,
67,
803,
262,
30,
1797,
273,
8247,
6283,
3113,
3774,
67,
803,
16,
3701,
16940,
3113,
3701,
2894,
24827,
3113,
225,
3701,
6406,
3113,
3774,
67,
803,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9804,
22,
6446,
12,
2890,
16,
3774,
67,
803,
262,
30,
1797,
273,
8247,
6283,
3113,
3774,
67,
803,
16,
3701,
16940,
3113,
3701,
2894,
24827,
3113,
225,
3701,
6406,
3113,
3774,
67,
803,
... |
print "Unexpected '%s'"%(" ".join(args)) print self.__doc__ | print "Unexpected '%s'"%word self.print_syntax() | def with_build_tree(self, builder, local_pkgs, args): force = False force_head = False filename = None | 5071266b53b7fa2e4320a1a23b23de497d404aee /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4427/5071266b53b7fa2e4320a1a23b23de497d404aee/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
598,
67,
3510,
67,
3413,
12,
2890,
16,
2089,
16,
1191,
67,
25376,
16,
833,
4672,
2944,
273,
1083,
2944,
67,
1978,
273,
1083,
1544,
273,
599,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
598,
67,
3510,
67,
3413,
12,
2890,
16,
2089,
16,
1191,
67,
25376,
16,
833,
4672,
2944,
273,
1083,
2944,
67,
1978,
273,
1083,
1544,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
z = repr_H_mod_N_over_d[d] v = [((u*x) % N, u, d, inverse_mod(x, N)) for x in z] reduct_data += v not_yet_done = list(set(not_yet_done).difference(set([a[0] for a in v]))) not_yet_done.sort() reduct_data.sort() reduct_data = [(a,b,c) for _,a,b,c in reduct_data] | for x in repr_H_mod_N_over_d[d]: reduct_data[(u*x)%N] = (u, d, inverse_mod(x,N)) | def _coset_reduction_data_first_coord(G): """ Compute data used for determining the canonical coset representative of an element of SL_2(Z) modulo G. This function specfically returns data needed for the first part of the reduction step (the first coordinate). | ee19a19f73bdcdc6c0b1860d28d316c82faa2cd5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/ee19a19f73bdcdc6c0b1860d28d316c82faa2cd5/congroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14445,
278,
67,
1118,
4062,
67,
892,
67,
3645,
67,
5732,
12,
43,
4672,
3536,
8155,
501,
1399,
364,
23789,
326,
7378,
4987,
278,
23174,
434,
392,
930,
434,
348,
48,
67,
22,
12,
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,
389,
14445,
278,
67,
1118,
4062,
67,
892,
67,
3645,
67,
5732,
12,
43,
4672,
3536,
8155,
501,
1399,
364,
23789,
326,
7378,
4987,
278,
23174,
434,
392,
930,
434,
348,
48,
67,
22,
12,
6... |
doday(mx.DateTime.DateTime(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3])) | doday(mx.DateTime.DateTime(int(sys.argv[1]), int(sys.argv[2]), int(sys.argv[3]))) | def doday(ts): """ Create a plot of precipitation stage4 estimates for some day """ sts = ts + mx.DateTime.RelativeDateTime(hour=1) ets = ts + mx.DateTime.RelativeDateTime(hour=0, days=1) interval = mx.DateTime.RelativeDateTime(hours=1) now = sts total = None lts = None while now < ets: fp = "/mesonet/ARCHIVE/data/%s/stage4/ST4.%s.01h.grib" % ( now.gmtime().strftime("%Y/%m/%d"), now.gmtime().strftime("%Y%m%d%H") ) if os.path.isfile(fp): lts = now grbs = pygrib.open(fp) if total is None: g = grbs[1] total = g["values"] lats, lons = g.latlons() else: total += grbs[1]["values"] grbs.close() now += interval # Now we dance cfg = { 'wkColorMap': 'BlAqGrYeOrRe', 'nglSpreadColorStart': -1, 'nglSpreadColorEnd' : 2, '_MaskZero' : True, 'lbTitleString' : "[inch]", '_valid' : 'Total up to %s' % (lts.strftime("%d %B %Y %I %p %Z"),), '_title' : "NCEP StageIV Today's Precipitation [inch]", } tmpfp = iemplot.simple_grid_fill(lons, lats, total / 25.4, cfg) pqstr = "plot ac %s00 iowa_stage4_1d.png iowa_stage4_1d.png png" % ( ts.strftime("%Y%m%d%H"), ) iemplot.postprocess(tmpfp, pqstr) # Midwest cfg['_midwest'] = True tmpfp = iemplot.simple_grid_fill(lons, lats, total / 25.4, cfg) pqstr = "plot ac %s00 midwest_stage4_1d.png midwest_stage4_1d.png png" % ( ts.strftime("%Y%m%d%H"), ) iemplot.postprocess(tmpfp, pqstr) del(cfg['_midwest']) # CONUS cfg['_conus'] = True tmpfp = iemplot.simple_grid_fill(lons, lats, total / 25.4, cfg) pqstr = "plot ac %s00 conus_stage4_1d.png conus_stage4_1d.png png" % ( ts.strftime("%Y%m%d%H"), ) iemplot.postprocess(tmpfp, pqstr) del(cfg['_conus']) | 8248e6f98d853d165b848b6f2bed8ff549df688a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11189/8248e6f98d853d165b848b6f2bed8ff549df688a/stage4_today_total.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
20136,
12,
3428,
4672,
3536,
1788,
279,
3207,
434,
675,
3449,
8773,
6009,
24,
27585,
364,
2690,
2548,
3536,
27099,
273,
3742,
397,
7938,
18,
5096,
18,
8574,
5096,
12,
12091,
33,
21,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
302,
20136,
12,
3428,
4672,
3536,
1788,
279,
3207,
434,
675,
3449,
8773,
6009,
24,
27585,
364,
2690,
2548,
3536,
27099,
273,
3742,
397,
7938,
18,
5096,
18,
8574,
5096,
12,
12091,
33,
21,... |
link_format= "<a href = \"%s\">%s</a>" | link_format= "<a href=\"%s\">%s</a>" | def send_to_graph(results_server, results_link, title, date, browser_config, results): tbox = title url_format = "http://%s/%s" link_format= "<a href = \"%s\">%s</a>" #value, testname, tbox, timeval, date, branch, buildid, type, data result_format = "%.2f,%s,%s,%d,%d,%s,%s,%s,%s,\n" result_format2 = "%.2f,%s,%s,%d,%d,%s,%s,%s,\n" links = '' for res in results: browser_dump, counter_dump = results[res] utils.debug("Working with test: " + res) utils.debug("Sending results: " + " ".join(browser_dump)) filename = tempfile.mktemp() tmpf = open(filename, "w") if res in ('ts', 'twinopen'): i = 0 for val in browser_dump: val_list = val.split('|') for v in val_list: tmpf.write(result_format % (float(v), res, tbox, i, date, browser_config['branch'], browser_config['buildid'], "discrete", "ms")) i += 1 else: # each line of the string is of the format i;page_name;median;mean;min;max;time vals\n name = '' if ((res == 'tp') or (res == 'tp_js')): name = '_loadtime' for bd in browser_dump: bd.rstrip('\n') page_results = bd.splitlines() i = 0 for mypage in page_results: r = mypage.split(';') #skip this line if it isn't the correct format if len(r) == 1: continue r[1] = r[1].rstrip('/') if r[1].find('/') > -1 : page = r[1].split('/')[1] else: page = r[1] try: val = float(r[2]) except ValueError: print 'WARNING: value error for median in tp' val = 0 tmpf.write(result_format % (val, res + name, tbox, i, date, browser_config['branch'], browser_config['buildid'], "discrete", page)) i += 1 tmpf.flush() tmpf.close() links += post_chunk(results_server, results_link, res, filename) os.remove(filename) for cd in counter_dump: for count_type in cd: val_list = cd[count_type] chunks = chunk_list(val_list) chunk_link = '' i = 0 for chunk in chunks: filename = tempfile.mktemp() tmpf = open(filename, "w") for val in chunk: tmpf.write(result_format2 % (float(val), res + "_" + count_type.replace("%", "Percent"), tbox, i, date, browser_config['branch'], browser_config['buildid'], "discrete")) i += 1 tmpf.flush() tmpf.close() chunk_link = post_chunk(results_server, results_link, '%s_%s (%d values)' % (res, count_type, len(chunk)), filename) os.remove(filename) links += chunk_link first_results = '' last_results = '' full_results = 'RETURN:<p style="font-size:smaller;">Details:<br>' lines = links.split('\n') for line in lines: if line == "": continue values = line.split(":") linkName = values[1] if linkName in ('tp_pbytes', 'tp_%cpu'): continue if float(values[2]) > 0: linkName += ": " + values[2] url = url_format % (results_server, values[0]) link = link_format % (url, linkName) first_results = first_results + "RETURN:" + link + '<br>' else: url = url_format % (results_server, values[0]) link = link_format % (url, linkName) last_results = last_results + '| ' + link + ' ' full_results = first_results + full_results + last_results + '|</p>' print full_results | f1b8f77bc5615ce42c2b970a9041ba56c2dfd1d0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/f1b8f77bc5615ce42c2b970a9041ba56c2dfd1d0/run_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
869,
67,
4660,
12,
4717,
67,
3567,
16,
1686,
67,
1232,
16,
2077,
16,
1509,
16,
4748,
67,
1425,
16,
1686,
4672,
268,
2147,
273,
2077,
880,
67,
2139,
273,
315,
2505,
23155,
8... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
869,
67,
4660,
12,
4717,
67,
3567,
16,
1686,
67,
1232,
16,
2077,
16,
1509,
16,
4748,
67,
1425,
16,
1686,
4672,
268,
2147,
273,
2077,
880,
67,
2139,
273,
315,
2505,
23155,
8... |
CreateDVDISO() | CreateDVDISO(title) | def processJob(job): """Starts processing a MythBurn job, expects XML nodes to be passed as input.""" global wantIntro, wantMainMenu, wantChapterMenu, wantDetailsPage global themeDOM, themeName, themeFonts media=job.getElementsByTagName("media") if media.length==1: themeName=job.attributes["theme"].value #Check theme exists if not validateTheme(themeName): fatalError("Failed to validate theme (%s)" % themeName) #Get the theme XML themeDOM = getThemeConfigurationXML(themeName) #Pre generate all the fonts we need loadFonts(themeDOM) #Update the global flags nodes=themeDOM.getElementsByTagName("intro") wantIntro = (nodes.length > 0) nodes=themeDOM.getElementsByTagName("menu") wantMainMenu = (nodes.length > 0) nodes=themeDOM.getElementsByTagName("submenu") wantChapterMenu = (nodes.length > 0) nodes=themeDOM.getElementsByTagName("detailspage") wantDetailsPage = (nodes.length > 0) write( "wantIntro: %d, wantMainMenu: %d, wantChapterMenu:%d, wantDetailsPage: %d" \ % (wantIntro, wantMainMenu, wantChapterMenu, wantDetailsPage)) if videomode=="ntsc": format=dvdNTSC dpi=dvdNTSCdpi elif videomode=="pal": format=dvdPAL dpi=dvdPALdpi else: fatalError("Unknown videomode is set (%s)" % videomode) write( "Final DVD Video format will be " + videomode) #Ensure the destination dvd folder is empty if doesFileExist(os.path.join(getTempPath(),"dvd")): deleteAllFilesInFolder(os.path.join(getTempPath(),"dvd")) #Loop through all the files files=media[0].getElementsByTagName("file") filecount=0 if files.length > 0: write( "There are %s files to process" % files.length) if debug_secondrunthrough==False: #Delete all the temporary files that currently exist deleteAllFilesInFolder(getTempPath()) #If User wants to, copy remote files to a tmp dir if copyremoteFiles==True: if debug_secondrunthrough==False: localCopyFolder=os.path.join(getTempPath(),"localcopy") #If it already exists destroy it to remove previous debris if os.path.exists(localCopyFolder): #Remove all the files first deleteAllFilesInFolder(localCopyFolder) #Remove the folder os.rmdir (localCopyFolder) os.makedirs(localCopyFolder) files=copyRemote(files,getTempPath()) #First pass through the files to be recorded - sense check #we dont want to find half way through this long process that #a file does not exist, or is the wrong format!! for node in files: filecount+=1 #Generate a temp folder name for this file folder=getItemTempPath(filecount) if debug_secondrunthrough==False: #If it already exists destroy it to remove previous debris if os.path.exists(folder): #Remove all the files first deleteAllFilesInFolder(folder) subtitlefolder = os.path.join(folder, "stream.d") if os.path.exists(subtitlefolder): deleteAllFilesInFolder(subtitlefolder) os.rmdir(subtitlefolder) previewfolder = os.path.join(folder, "preview") if os.path.exists(previewfolder): deleteAllFilesInFolder(previewfolder) os.rmdir(previewfolder) #Remove the folder os.rmdir (folder) os.makedirs(folder) #Do the pre-process work preProcessFile(node,folder) if debug_secondrunthrough==False: #Loop through all the files again but this time do more serious work! filecount=0 for node in files: filecount+=1 folder=getItemTempPath(filecount) #Process this file processFile(node,folder) #We can only create the menus after the videos have been processed #and the commercials cut out so we get the correct run time length #for the chapter marks and thumbnails. #create the DVD menus... if wantMainMenu: createMenu(format, dpi, files.length) #Submenus are visible when you select the chapter menu while the recording is playing if wantChapterMenu: createChapterMenu(format, dpi, files.length) #Details Page are displayed just before playing each recording if wantDetailsPage: createDetailsPage(format, dpi, files.length) #DVD Author file if not wantMainMenu and not wantChapterMenu: createDVDAuthorXMLNoMenus(format, files.length) elif not wantMainMenu: createDVDAuthorXMLNoMainMenu(format, files.length) else: createDVDAuthorXML(format, files.length) #Check all the files will fit onto a recordable DVD if mediatype == DVD_DL: # dual layer performMPEG2Shrink(files, dvdrsize[1]) else: #single layer performMPEG2Shrink(files, dvdrsize[0]) filecount=0 for node in files: filecount+=1 folder=getItemTempPath(filecount) #Multiplex this file #(This also removes non-required audio feeds inside mpeg streams #(through re-multiplexing) we only take 1 video and 1 or 2 audio streams) pid=multiplexMPEGStream(os.path.join(folder,'stream.mv2'), os.path.join(folder,'stream0'), os.path.join(folder,'stream1'), os.path.join(folder,'final.mpg'), calcSyncOffset(filecount)) #Now all the files are completed and ready to be burnt runDVDAuthor() #Create the DVD ISO image if docreateiso == True or mediatype == FILE: CreateDVDISO() #Burn the DVD ISO image if doburn == True and mediatype != FILE: BurnDVDISO() #Move the created iso image to the given location if mediatype == FILE and savefilename != "": write("Moving ISO image to: %s" % savefilename) try: os.rename(os.path.join(getTempPath(), 'mythburn.iso'), savefilename) except: f1 = open(os.path.join(getTempPath(), 'mythburn.iso'), 'rb') f2 = open(savefilename, 'wb') data = f1.read(1024 * 1024) while data: f2.write(data) data = f1.read(1024 * 1024) f1.close() f2.close() os.unlink(os.path.join(getTempPath(), 'mythburn.iso')) else: write( "Nothing to do! (files)") else: write( "Nothing to do! (media)") return | 87ee8e4938a9bc41c4ba992fd57f61744dee45ce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13713/87ee8e4938a9bc41c4ba992fd57f61744dee45ce/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
2278,
12,
4688,
4672,
3536,
11203,
4929,
279,
8005,
451,
38,
321,
1719,
16,
10999,
3167,
2199,
358,
506,
2275,
487,
810,
12123,
2552,
2545,
1702,
303,
16,
2545,
6376,
4599,
16,
254... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
2278,
12,
4688,
4672,
3536,
11203,
4929,
279,
8005,
451,
38,
321,
1719,
16,
10999,
3167,
2199,
358,
506,
2275,
487,
810,
12123,
2552,
2545,
1702,
303,
16,
2545,
6376,
4599,
16,
254... |
logging.error("File isn't inside project base: " + l_file_path) | logging.error("File isn't inside project root: " + l_file_path) | def add_file ( self, p_file_path ): | ff552e9041f2356e9589089548cf50e78d32566e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2506/ff552e9041f2356e9589089548cf50e78d32566e/project.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
768,
261,
365,
16,
293,
67,
768,
67,
803,
262,
30,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
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,
527,
67,
768,
261,
365,
16,
293,
67,
768,
67,
803,
262,
30,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
@return: A Deferred, the callback for which will be called when the server clarifies the deletion of the group. The callback argument will be a tuple with 2 elements: the new list version (int) and the group ID (int) of the removed group. | @return: A Deferred, the callback for which will be called when the server clarifies the deletion of the group. The callback argument will be a tuple with 2 elements: the new list version (int) and the group ID (int) of the removed group. | def remListGroup(self, groupID): """ used to remove a list group. | 9b2b7163e441396d9e5e7f46775cd7809b4655be /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/9b2b7163e441396d9e5e7f46775cd7809b4655be/msn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
849,
682,
1114,
12,
2890,
16,
30365,
4672,
3536,
1399,
358,
1206,
279,
666,
1041,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
849,
682,
1114,
12,
2890,
16,
30365,
4672,
3536,
1399,
358,
1206,
279,
666,
1041,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
testit('rint(0.7)', math.rint(0.7), 1) testit('rint(-0.3)', math.rint(-0.3), 0) testit('rint(2.5)', math.rint(2.5), 2) testit('rint(3.5)', math.rint(3.5), 4) | try: math.rint except AttributeError: pass else: testit('rint(0.7)', math.rint(0.7), 1) testit('rint(-0.3)', math.rint(-0.3), 0) testit('rint(2.5)', math.rint(2.5), 2) testit('rint(3.5)', math.rint(3.5), 4) | def testmodf(name, (v1, v2), (e1, e2)): if abs(v1-e1) > eps or abs(v2-e2): raise TestFailed, '%s returned %s, expected %s'%\ (name, `v1,v2`, `e1,e2`) | 574d5db4b384c6ca4e47a6a6c75149c48a281dd6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/574d5db4b384c6ca4e47a6a6c75149c48a281dd6/test_math.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1711,
74,
12,
529,
16,
261,
90,
21,
16,
331,
22,
3631,
261,
73,
21,
16,
425,
22,
3719,
30,
309,
2417,
12,
90,
21,
17,
73,
21,
13,
405,
7785,
578,
2417,
12,
90,
22,
17,
73... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
1711,
74,
12,
529,
16,
261,
90,
21,
16,
331,
22,
3631,
261,
73,
21,
16,
425,
22,
3719,
30,
309,
2417,
12,
90,
21,
17,
73,
21,
13,
405,
7785,
578,
2417,
12,
90,
22,
17,
73... |
def get_track_by_mbid(mbid, api_key, api_secret, session_key): | def get_track_by_mbid(mbid, api_key, api_secret, session_key=""): | def get_track_by_mbid(mbid, api_key, api_secret, session_key): """Looks up a track by its MusicBrainz ID.""" params = {"mbid": unicode(mbid)} doc = _Request("track.getInfo", params, api_key, api_secret, session_key).execute(True) return Track(_extract(doc, "name", 1), _extract(doc, "name"), api_key, api_secret, session_key) | 8d8063afe8067477accae5bef5e470a4a3cbfa5d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9926/8d8063afe8067477accae5bef5e470a4a3cbfa5d/pylast.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4101,
67,
1637,
67,
1627,
350,
12,
1627,
350,
16,
1536,
67,
856,
16,
1536,
67,
5875,
16,
1339,
67,
856,
1546,
6,
4672,
3536,
20475,
731,
279,
3298,
635,
2097,
490,
14894,
38... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4101,
67,
1637,
67,
1627,
350,
12,
1627,
350,
16,
1536,
67,
856,
16,
1536,
67,
5875,
16,
1339,
67,
856,
1546,
6,
4672,
3536,
20475,
731,
279,
3298,
635,
2097,
490,
14894,
38... |
assert before.time == 98 assert before.weight == 2 assert before.dist_walked == 2.0 | print before assert before.time == 100 - (10/2) assert before.weight == 10/2 assert before.dist_walked == 10.0 | def test_walk_back(self): s = Egress("longstreet", 2) before = s.walk_back(State(0,100),WalkOptions()) assert before.time == 98 assert before.weight == 2 assert before.dist_walked == 2.0 assert before.prev_edge_type == 12 assert before.prev_edge_name == "longstreet" assert before.num_agencies == 0 | 508050e46940a166eed1f6861034e5a50d05f2bf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10974/508050e46940a166eed1f6861034e5a50d05f2bf/unit_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
11348,
67,
823,
12,
2890,
4672,
272,
273,
512,
2329,
2932,
5748,
22424,
3113,
576,
13,
225,
1865,
273,
272,
18,
11348,
67,
823,
12,
1119,
12,
20,
16,
6625,
3631,
9463,
1320,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
11348,
67,
823,
12,
2890,
4672,
272,
273,
512,
2329,
2932,
5748,
22424,
3113,
576,
13,
225,
1865,
273,
272,
18,
11348,
67,
823,
12,
1119,
12,
20,
16,
6625,
3631,
9463,
1320,
... |
dll_path = os.path.join(srcdir, "PCBuild", dll_file) msilib.set_arch_from_file(dll_path) | # Target files (.def and .a) go in PCBuild directory | 60bf22bf2d5248d061c52aed29d8d00f4cdcf6d7 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/60bf22bf2d5248d061c52aed29d8d00f4cdcf6d7/msi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
5916,
1390,
261,
18,
536,
471,
263,
69,
13,
1960,
316,
26300,
3116,
1867,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
468,
5916,
1390,
261,
18,
536,
471,
263,
69,
13,
1960,
316,
26300,
3116,
1867,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
f.write('<HTML>'+str(self.ReportText.text())+'</HTML>') | f.write('<HTML>'+str(self.ReportText.toHtml())+'</HTML>') | def saveToHTML(self): filename = QFileDialog.getSaveFileName('', "HTML (*.html)") if filename is not None and str(filename) != '': try: if re.compile('\.html$').search(str(filename)) is None: filename = str(filename) filename += '.html' f = open(str(filename), 'w') f.write('<HTML>'+str(self.ReportText.text())+'</HTML>') f.close() except IOError: QMessageBox.critical(None, 'Error!', 'Error writing to file: ' + filename, 'OK') | 28de507d7877175204fe5d32b6d98c2845ccddea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6671/28de507d7877175204fe5d32b6d98c2845ccddea/ReportWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
774,
4870,
12,
2890,
4672,
1544,
273,
2238,
812,
6353,
18,
588,
4755,
4771,
2668,
2187,
315,
4870,
261,
11146,
2620,
2225,
13,
309,
1544,
353,
486,
599,
471,
609,
12,
3459,
13,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
774,
4870,
12,
2890,
4672,
1544,
273,
2238,
812,
6353,
18,
588,
4755,
4771,
2668,
2187,
315,
4870,
261,
11146,
2620,
2225,
13,
309,
1544,
353,
486,
599,
471,
609,
12,
3459,
13,
4... |
def initialize(self): BaseLBFGS.initialize(self) self.Ho = 0.05 | def initialize(self): BaseLBFGS.initialize(self) self.Ho = 0.05 | e4186acc11663a2a2c70c16ef0b0536e66a7b908 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5735/e4186acc11663a2a2c70c16ef0b0536e66a7b908/lbfgs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
for source in sources: (base, ext) = os.path.splitext(source) if ext == ".i": new_sources.append(base + target_ext) swig_sources.append(source) swig_targets[source] = new_sources[-1] | if self.swig_cpp: target_ext = '.cpp' | def swig_sources (self, sources): """Walk the list of source files in 'sources', looking for SWIG interface (.i) files. Run SWIG on all that are found, and return a modified 'sources' list with SWIG source files replaced by the generated C (or C++) files. """ new_sources = [] swig_sources = [] swig_targets = {} # XXX this drops generated C/C++ files into the source tree, which # is fine for developers who want to distribute the generated # source -- but there should be an option to put SWIG output in # the temp dir. if self.swig_cpp: target_ext = '.cpp' else: target_ext = '.c' for source in sources: (base, ext) = os.path.splitext(source) if ext == ".i": # SWIG interface file new_sources.append(base + target_ext) swig_sources.append(source) swig_targets[source] = new_sources[-1] else: new_sources.append(source) if not swig_sources: return new_sources swig = self.find_swig() swig_cmd = [swig, "-python", "-ISWIG"] if self.swig_cpp: swig_cmd.append("-c++") for source in swig_sources: target = swig_targets[source] self.announce("swigging %s to %s" % (source, target)) self.spawn(swig_cmd + ["-o", target, source]) return new_sources | a3445be2469ebc765311af9285429177182b14f6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8055/a3445be2469ebc765311af9285429177182b14f6/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
10141,
261,
2890,
16,
5550,
4672,
225,
3536,
9463,
326,
666,
434,
1084,
1390,
316,
296,
10141,
2187,
7849,
364,
16392,
3047,
1560,
261,
18,
77,
13,
1390,
18,
225,
1939,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1352,
360,
67,
10141,
261,
2890,
16,
5550,
4672,
225,
3536,
9463,
326,
666,
434,
1084,
1390,
316,
296,
10141,
2187,
7849,
364,
16392,
3047,
1560,
261,
18,
77,
13,
1390,
18,
225,
1939,
... |
"Called when an error has occurred" self.errors.append((test, err)) | """Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info(). """ self.errors.append((test, self._exc_info_to_string(err))) | def addError(self, test, err): "Called when an error has occurred" self.errors.append((test, err)) | 9f052c82d1f48e9b8df59fbb8f8ed1fb6370440a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/9f052c82d1f48e9b8df59fbb8f8ed1fb6370440a/unittest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9501,
12,
2890,
16,
1842,
16,
393,
4672,
315,
8185,
1347,
392,
555,
711,
7841,
6,
365,
18,
4324,
18,
6923,
12443,
3813,
16,
393,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9501,
12,
2890,
16,
1842,
16,
393,
4672,
315,
8185,
1347,
392,
555,
711,
7841,
6,
365,
18,
4324,
18,
6923,
12443,
3813,
16,
393,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
fr = fr.f_back | fr = fr.f_back | def getlocals(back=2): """Get the local variables some levels back (-1 is top).""" import inspect fr = inspect.currentframe() try: while fr and back!=0: fr1 = fr; fr = fr.f_back back -= 1 except: pass return fr1.f_locals | 4f69430b7199d7a36568f5b8c5606ff94d204949 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7472/4f69430b7199d7a36568f5b8c5606ff94d204949/substitute.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
17977,
12,
823,
33,
22,
4672,
3536,
967,
326,
1191,
3152,
2690,
7575,
1473,
24927,
21,
353,
1760,
13,
12123,
1930,
5334,
3812,
273,
5334,
18,
2972,
3789,
1435,
775,
30,
1323,
3812,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
17977,
12,
823,
33,
22,
4672,
3536,
967,
326,
1191,
3152,
2690,
7575,
1473,
24927,
21,
353,
1760,
13,
12123,
1930,
5334,
3812,
273,
5334,
18,
2972,
3789,
1435,
775,
30,
1323,
3812,
... |
""" | r""" | def OctalStrings(): """ Returns the free octal string monoid on generators $\{0,1,..,7\}$. INPUT: None OUTPUT: Free octal string monoid EXAMPLES: sage: S = OctalStrings(); S Free octal string monoid sage: x = S.gens() sage: x[0] 0 sage: x[7] 7 sage: x[0] * x[3]^3 * x[5]^4 * x[6] 033355556 """ # Here we cache the octal strings to make them unique if _cache.has_key(8): S = _cache[8]() if not S is None: return S S = OctalStringMonoid() _cache[8] = weakref.ref(S) return S | ca219b0206186a194cdf8e11d2082bec654536f8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/ca219b0206186a194cdf8e11d2082bec654536f8/string_monoid.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29482,
287,
7957,
13332,
436,
8395,
2860,
326,
4843,
10844,
287,
533,
6921,
839,
603,
13327,
271,
64,
95,
20,
16,
21,
16,
838,
16,
27,
64,
22496,
18,
225,
12943,
30,
599,
225,
11550,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
29482,
287,
7957,
13332,
436,
8395,
2860,
326,
4843,
10844,
287,
533,
6921,
839,
603,
13327,
271,
64,
95,
20,
16,
21,
16,
838,
16,
27,
64,
22496,
18,
225,
12943,
30,
599,
225,
11550,
... |
raise CustomError2 | raise customError2 | def f(x): if x == 0: raise CustomError1 if x == 1: raise CustomError2 | 46ec8039da261e53e168cf43097fa982526409d9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6934/46ec8039da261e53e168cf43097fa982526409d9/test_inline.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
92,
4672,
309,
619,
422,
374,
30,
1002,
6082,
668,
21,
309,
619,
422,
404,
30,
1002,
6082,
668,
22,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
92,
4672,
309,
619,
422,
374,
30,
1002,
6082,
668,
21,
309,
619,
422,
404,
30,
1002,
6082,
668,
22,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
corresponds to the ordering of the list. However, in general there is no way to canonically list (or index) the conjugacy classes of a group. Therefore the ordering of the columns of the character table of a group is somewhat random. | corresponds to the ordering of the list. However, in general there is no way to canonically list (or index) the conjugacy classes of a group. Therefore the ordering of the columns of the character table of a group is somewhat random. | def character_table(self): r""" Returns the matrix of values of the irreducible characters of a permutation group `G` at the conjugacy classes of `G`. The columns represent the the conjugacy classes of `G` and the rows represent the different irreducible characters in the ordering given by GAP. EXAMPLES:: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) sage: G.order() 12 sage: G.character_table() [ 1 1 1 1] [ 1 1 -zeta3 - 1 zeta3] [ 1 1 zeta3 -zeta3 - 1] [ 3 -1 0 0] sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3)]]) sage: CT = gap(G).CharacterTable() Type ``print gap.eval("Display(%s)"%CT.name())`` to display this nicely. :: sage: G = PermutationGroup([[(1,2),(3,4)], [(1,2,3,4)]]) sage: G.order() 8 sage: G.character_table() [ 1 1 1 1 1] [ 1 -1 -1 1 1] [ 1 -1 1 -1 1] [ 1 1 -1 -1 1] [ 2 0 0 0 -2] sage: CT = gap(G).CharacterTable() Again, type ``print gap.eval("Display(%s)"%CT.name())`` to display this nicely. :: sage: SymmetricGroup(2).character_table() [ 1 -1] [ 1 1] sage: SymmetricGroup(3).character_table() [ 1 -1 1] [ 2 0 -1] [ 1 1 1] sage: SymmetricGroup(5).character_table() [ 1 -1 1 1 -1 -1 1] [ 4 -2 0 1 1 0 -1] [ 5 -1 1 -1 -1 1 0] [ 6 0 -2 0 0 0 1] [ 5 1 1 -1 1 -1 0] [ 4 2 0 1 -1 0 -1] [ 1 1 1 1 1 1 1] sage: list(AlternatingGroup(6).character_table()) [(1, 1, 1, 1, 1, 1, 1), (5, 1, 2, -1, -1, 0, 0), (5, 1, -1, 2, -1, 0, 0), (8, 0, -1, -1, 0, zeta5^3 + zeta5^2 + 1, -zeta5^3 - zeta5^2), (8, 0, -1, -1, 0, -zeta5^3 - zeta5^2, zeta5^3 + zeta5^2 + 1), (9, 1, 0, 0, 1, -1, -1), (10, -2, 1, 1, 0, 0, 0)] Suppose that you have a class function `f(g)` on `G` and you know the values `v_1, ..., v_n` on the conjugacy class elements in ``conjugacy_classes_representatives(G)`` = `[g_1, \ldots, g_n]`. Since the irreducible characters `\rho_1, \ldots, \rho_n` of `G` form an `E`-basis of the space of all class functions (`E` a "sufficiently large" cyclotomic field), such a class function is a linear combination of these basis elements, `f = c_1\rho_1 + \cdots + c_n\rho_n`. To find the coefficients `c_i`, you simply solve the linear system ``character_table_values(G)``\*`[v_1, ..., v_n] = [c_1, ..., c_n]`, where `[v_1, ...,v_n]` = ``character_table_values(G)`` `^{-1}[c_1, ...,c_n]`. AUTHORS: - David Joyner and William Stein (2006-01-04) | 6ac30ecf5071d4fb909072e90d2311932d8c2165 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/6ac30ecf5071d4fb909072e90d2311932d8c2165/permgroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3351,
67,
2121,
12,
2890,
4672,
436,
8395,
2860,
326,
3148,
434,
924,
434,
326,
9482,
1118,
5286,
1523,
3949,
434,
279,
17440,
1041,
1375,
43,
68,
622,
326,
10550,
637,
3505,
3318,
434,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3351,
67,
2121,
12,
2890,
4672,
436,
8395,
2860,
326,
3148,
434,
924,
434,
326,
9482,
1118,
5286,
1523,
3949,
434,
279,
17440,
1041,
1375,
43,
68,
622,
326,
10550,
637,
3505,
3318,
434,
... |
def run_once(self, qemu_path='', options='', testlist=''): | def run_once(self, options='', testlist=''): | def run_once(self, qemu_path='', options='', testlist=''): """ Passes the appropriate parameters to the testsuite. | 1a117ea0f8a94f940fdea6d76a61ee0cef763c55 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10349/1a117ea0f8a94f940fdea6d76a61ee0cef763c55/qemu_iotests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
12,
2890,
16,
702,
2218,
2187,
1842,
1098,
2218,
11,
4672,
3536,
10311,
281,
326,
5505,
1472,
358,
326,
7434,
9519,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
12,
2890,
16,
702,
2218,
2187,
1842,
1098,
2218,
11,
4672,
3536,
10311,
281,
326,
5505,
1472,
358,
326,
7434,
9519,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
this = apply(_quickfix.new_LongQty, args) | this = _quickfix.new_LongQty(*args) | def __init__(self, *args): this = apply(_quickfix.new_LongQty, 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,
3708,
53,
4098,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
3708,
53,
4098,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
36... |
if not mysqlInstalled()['OK']: return S_ERROR( 'MySQL not properly Installed' ) | result = mysqlInstalled() if not result['OK']: return result | def startMySQL(): """ Start MySQL server """ if not mysqlInstalled()['OK']: return S_ERROR( 'MySQL not properly Installed' ) return execCommand( 0, [mysqlStartupScript, 'start'] ) | 19ec07f0c2998016b3e98f643782f5cf2dff8b15 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/19ec07f0c2998016b3e98f643782f5cf2dff8b15/InstallTools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
28723,
13332,
3536,
3603,
13485,
1438,
3536,
563,
273,
7219,
16747,
1435,
309,
486,
563,
3292,
3141,
3546,
30,
327,
563,
327,
1196,
2189,
12,
374,
16,
306,
12527,
22178,
3651,
16,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
787,
28723,
13332,
3536,
3603,
13485,
1438,
3536,
563,
273,
7219,
16747,
1435,
309,
486,
563,
3292,
3141,
3546,
30,
327,
563,
327,
1196,
2189,
12,
374,
16,
306,
12527,
22178,
3651,
16,
2... |
return | return | def __setattr__(self, attr, val): newattr = attr not in self.__dict__ try: # Is attr a generic attribute ? ret = object.__setattr__(self, attr, val) except: # Not a generic attribute: exit if it's not a valid field fielddict = self.dtype.names or {} if attr not in fielddict: exctype, value = sys.exc_info()[:2] raise exctype, value else: if attr not in list(self.dtype.names) + ['_mask']: return ret if newattr: # We just added this one try: # or this setattr worked on an internal # attribute. object.__delattr__(self, attr) except: return ret # Case #1.: Basic field ............ base_fmask = self._fieldmask _names = self.dtype.names if attr in _names: fval = filled(val) mval = getmaskarray(val) if self._hardmask: mval = mask_or(mval, base_fmask.__getattr__(attr)) self._data.__setattr__(attr, fval) base_fmask.__setattr__(attr, mval) return elif attr == '_mask': if self._hardmask: val = make_mask(val) if val is not nomask: | c23755afc12e34291055167a63fc030669da9163 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/c23755afc12e34291055167a63fc030669da9163/tmulti.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1747,
972,
12,
2890,
16,
1604,
16,
1244,
4672,
394,
1747,
273,
1604,
486,
316,
365,
16186,
1576,
972,
775,
30,
468,
2585,
1604,
279,
5210,
1566,
692,
325,
273,
733,
16186,
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,
542,
1747,
972,
12,
2890,
16,
1604,
16,
1244,
4672,
394,
1747,
273,
1604,
486,
316,
365,
16186,
1576,
972,
775,
30,
468,
2585,
1604,
279,
5210,
1566,
692,
325,
273,
733,
16186,
5... |
Returns then n-th Lucas number ``of the second kind'' (this is not | Returns the n-th Lucas number ``of the second kind'' (this is not | def lucas_number2(n,P,Q): r""" Returns then n-th Lucas number ``of the second kind'' (this is not standard terminology). The Lucas sequence $L^{(2)}_n$ is defined by the initial conditions $L^{(2)}_1=2$, $L^{(2)}_2=P$ and the recurrence relation $L^{(2)}_{n+2} = P*L^{(2)}_{n+1} - Q*L^{(2)}_n$. Wraps GAP's Lucas(...)[2]. INPUT: n -- integer P, Q -- integer or rational numbers OUTPUT: integer or rational number EXAMPLES: sage: [lucas_number2(i,1,-1) for i in range(10)] [2, 1, 3, 4, 7, 11, 18, 29, 47, 76] sage: [fibonacci(i-1)+fibonacci(i+1) for i in range(10)] [2, 1, 3, 4, 7, 11, 18, 29, 47, 76] sage: n = lucas_number2(5,2,3); n 2 sage: type(n) <type 'sage.rings.integer.Integer'> sage: n = lucas_number2(5,2,-3/9); n 418/9 sage: type(n) <type 'sage.rings.rational.Rational'> The case P=1, Q=-1 is the Lucas sequence in Brualdi's {\bf Introductory Combinatorics}, 4th ed., Prentice-Hall, 2004: sage: [lucas_number2(n,1,-1) for n in range(10)] [2, 1, 3, 4, 7, 11, 18, 29, 47, 76] """ ans=gap.eval("Lucas(%s,%s,%s)[2]"%(QQ._coerce_(P),QQ._coerce_(Q),ZZ(n))) return sage_eval(ans) | 8b6cc309d81329ac887f73256610611664d8fcd5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/8b6cc309d81329ac887f73256610611664d8fcd5/combinat.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
328,
5286,
345,
67,
2696,
22,
12,
82,
16,
52,
16,
53,
4672,
436,
8395,
2860,
326,
290,
17,
451,
511,
5286,
345,
1300,
12176,
792,
326,
2205,
3846,
6309,
261,
2211,
353,
486,
4529,
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,
328,
5286,
345,
67,
2696,
22,
12,
82,
16,
52,
16,
53,
4672,
436,
8395,
2860,
326,
290,
17,
451,
511,
5286,
345,
1300,
12176,
792,
326,
2205,
3846,
6309,
261,
2211,
353,
486,
4529,
16... |
if self.config.get('warn', 'pm_global') == '1': | try: pmglobal = self.config.get('warn', 'pm_global') except: pmglobal = '0' if pmglobal == '1': | def warnClient(self, sclient, keyword, admin=None, timer=True, data='', newDuration=None): try: duration, warning = self.getWarning(keyword) except: duration, warning = self.getWarning('generic') warning = '%s %s' % (warning, keyword) | 759ad2e07d896b4368b200f2d8305d46993ba7f5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12909/759ad2e07d896b4368b200f2d8305d46993ba7f5/admin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1894,
1227,
12,
2890,
16,
888,
676,
16,
4932,
16,
3981,
33,
7036,
16,
5441,
33,
5510,
16,
501,
2218,
2187,
394,
5326,
33,
7036,
4672,
775,
30,
3734,
16,
3436,
273,
365,
18,
588,
6210... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1894,
1227,
12,
2890,
16,
888,
676,
16,
4932,
16,
3981,
33,
7036,
16,
5441,
33,
5510,
16,
501,
2218,
2187,
394,
5326,
33,
7036,
4672,
775,
30,
3734,
16,
3436,
273,
365,
18,
588,
6210... |
group_id = self.id_get(cr, 'res.groups', group[1:]) | group_id = self.id_get(cr, group[1:]) | def _tag_wizard(self, cr, rec, data_node=None): string = rec.get("string",'').encode('utf8') model = rec.get("model",'').encode('utf8') name = rec.get("name",'').encode('utf8') xml_id = rec.get('id','').encode('utf8') self._test_xml_id(xml_id) multi = rec.get('multi','') and eval(rec.get('multi','False')) res = {'name': string, 'wiz_name': name, 'multi': multi, 'model': model} | 07a4bc7f3fdbd5f93ba4a066290ae65a3016075c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/07a4bc7f3fdbd5f93ba4a066290ae65a3016075c/convert.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2692,
67,
31837,
12,
2890,
16,
4422,
16,
1950,
16,
501,
67,
2159,
33,
7036,
4672,
533,
273,
1950,
18,
588,
2932,
1080,
3113,
6309,
2934,
3015,
2668,
3158,
28,
6134,
938,
273,
1950... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2692,
67,
31837,
12,
2890,
16,
4422,
16,
1950,
16,
501,
67,
2159,
33,
7036,
4672,
533,
273,
1950,
18,
588,
2932,
1080,
3113,
6309,
2934,
3015,
2668,
3158,
28,
6134,
938,
273,
1950... |
return S_ERROR('File does not exist at specified source site.') else: tree = self.__simple(sourceSE,targetSEs) elif re.search('DynamicThroughput',strategy): elements = strategy.split('_') if len(elements) > 1: self.sigma = float(elements[-1]) | return S_ERROR( 'File does not exist at specified source site.' ) else: tree = self.__simple( sourceSE, targetSEs ) elif re.search( 'DynamicThroughput', strategy ): elements = strategy.split( '_' ) if len( elements ) > 1: self.sigma = float( elements[-1] ) | def determineReplicationTree(self,sourceSE,targetSEs,replicas,size,strategy=None,sigma=None): """ """ if not strategy: strategy = self.__selectStrategy() | 9005c0a96ba1bc0698c543bcb4c1886f4eeee344 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9005c0a96ba1bc0698c543bcb4c1886f4eeee344/ReplicationScheduler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4199,
8309,
2471,
12,
2890,
16,
3168,
1090,
16,
3299,
1090,
87,
16,
266,
10528,
16,
1467,
16,
14914,
33,
7036,
16,
13201,
33,
7036,
4672,
3536,
3536,
309,
486,
6252,
30,
6252,
273,
365... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4199,
8309,
2471,
12,
2890,
16,
3168,
1090,
16,
3299,
1090,
87,
16,
266,
10528,
16,
1467,
16,
14914,
33,
7036,
16,
13201,
33,
7036,
4672,
3536,
3536,
309,
486,
6252,
30,
6252,
273,
365... |
sage: J.basis() | sage: J.basis() | def basis(self): """ Return an immutable sequence of elements of this ideal (note: their parent is the number field) that form a basis for this ideal viewed as a ZZ-module. | 5a0e2c618364767a01fc42126783eafd365abe47 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/5a0e2c618364767a01fc42126783eafd365abe47/number_field_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10853,
12,
2890,
4672,
3536,
2000,
392,
11732,
3102,
434,
2186,
434,
333,
23349,
261,
7652,
30,
3675,
982,
353,
326,
1300,
652,
13,
716,
646,
279,
10853,
364,
333,
23349,
1476,
329,
487,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10853,
12,
2890,
4672,
3536,
2000,
392,
11732,
3102,
434,
2186,
434,
333,
23349,
261,
7652,
30,
3675,
982,
353,
326,
1300,
652,
13,
716,
646,
279,
10853,
364,
333,
23349,
1476,
329,
487,... |
groups = self.listGroups()['Value'] for userGroup in properties[ 'Groups' ]: if not userGroup in groups: gLogger.error( "User %s group %s is not a valid group" % ( username, userGroup ) ) return S_OK( False ) | def modifyUser( self, username, properties, createIfNonExistant = False ): """ Modify a user -username -properties is a dict with keys: DN Groups <extra params> Returns True/False """ if not self.__initialized: return S_ERROR( "CSAPI didn't initialize properly" ) modifiedUser = False userData = self.describeUsers( [ username ] )['Value'] if username not in userData: if createIfNonExistant: gLogger.info( "Registering user %s" % username ) return self.addUser( username, properties ) gLogger.error( "User %s is not registered" % username ) return S_OK( False ) groups = self.listGroups()['Value'] for userGroup in properties[ 'Groups' ]: if not userGroup in groups: gLogger.error( "User %s group %s is not a valid group" % ( username, userGroup ) ) return S_OK( False ) for prop in properties: if prop == "Groups": continue prevVal = self.__csMod.getValue( "%s/Users/%s/%s" % ( self.__baseSecurity, username, prop ) ) if not prevVal or prevVal != properties[ prop ]: gLogger.info( "Setting %s property for user %s to %s" % ( prop, username, properties[ prop ] ) ) self.__csMod.setOptionValue( "%s/Users/%s/%s" % ( self.__baseSecurity, username, prop ), properties[ prop ] ) modifiedUser = True groupsToBeDeletedFrom = [] groupsToBeAddedTo = [] for prevGroup in userData[ username ][ 'Groups' ]: if prevGroup not in properties[ 'Groups' ]: groupsToBeDeletedFrom.append( prevGroup ) modifiedUser = True for newGroup in properties[ 'Groups' ]: if newGroup not in userData[ username ][ 'Groups' ]: groupsToBeAddedTo.append( newGroup ) modifiedUser = True for group in groupsToBeDeletedFrom: self.__removeUserFromGroup( group, username ) gLogger.info( "Removed user %s from group %s" % ( username, group ) ) for group in groupsToBeAddedTo: self.__addUserToGroup( group, username ) gLogger.info( "Added user %s to group %s" % ( username, group ) ) if modifiedUser: gLogger.info( "Modified user %s" % username ) self.__csModified = True else: gLogger.info( "Nothing to modify for user %s" % username ) return S_OK( True ) | 7bdadc55ada56e9516c6dac26f50d02319542f61 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12864/7bdadc55ada56e9516c6dac26f50d02319542f61/CSAPI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5612,
1299,
12,
365,
16,
2718,
16,
1790,
16,
752,
2047,
3989,
4786,
970,
273,
1083,
262,
30,
3536,
9518,
279,
729,
300,
5053,
300,
4738,
353,
279,
2065,
598,
1311,
30,
18001,
14712,
41... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5612,
1299,
12,
365,
16,
2718,
16,
1790,
16,
752,
2047,
3989,
4786,
970,
273,
1083,
262,
30,
3536,
9518,
279,
729,
300,
5053,
300,
4738,
353,
279,
2065,
598,
1311,
30,
18001,
14712,
41... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.