rem stringlengths 1 226k | add stringlengths 0 227k | context stringlengths 6 326k | meta stringlengths 143 403 | input_ids listlengths 256 256 | attention_mask listlengths 256 256 | labels listlengths 128 128 |
|---|---|---|---|---|---|---|
osd.clearscreen() osd.drawstring('File "%s" not found!' % filename, 30, 280) osd.update() | skin.PopupBox('%s\nnot found!' % filename) | def play(self, mode, file, playlist, repeat=0): | 5911d2b889a00ee6cc64145b100579deb2e512d4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/5911d2b889a00ee6cc64145b100579deb2e512d4/mplayer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6599,
12,
2890,
16,
1965,
16,
585,
16,
16428,
16,
7666,
33,
20,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
6599,
12,
2890,
16,
1965,
16,
585,
16,
16428,
16,
7666,
33,
20,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
try: return self.tk.call(self._w, 'subwidget', name) except TclError: return None | try: return self.tk.call(self._w, 'subwidget', name) except TclError: return None | def _subwidget_name(self,name): | 22710823fb554a796dc96c44885d7a9389426824 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/22710823fb554a796dc96c44885d7a9389426824/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1717,
6587,
67,
529,
12,
2890,
16,
529,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1717,
6587,
67,
529,
12,
2890,
16,
529,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
e_date = "%s/%s/%s" %(endTime.month, endTime.day, endTime.year) if not dict[field] == e_date : self.logger.ReportFailure("(On end date Checking) || object end date = %s ; expected end date = %s" %(e_date, dict[field])) | e_date = self.formatDate("%s/%s/%s" %(endTime.month, endTime.day, endTime.year)) dictDate = self.formatDate(dict[field]) if not dictDate == e_date : self.logger.ReportFailure("(On end date Checking) || object end date = %s ; expected end date = %s" %(e_date, dictDate)) | def Check_Object(self, dict): """ Check expected value by comparison to the data contained in the object attributes @type dict : dictionnary @param dict : dictionnary with expected item attributes values for checking {"attributeName":"expected value",...} """ self.logger.SetChecked(True) # check the changing values for field in dict.keys(): if field == "displayName": # display name checking if self.isMessage: d_name = "%s" %self.item.subject else: d_name = "%s" %self.item.displayName if not dict[field] == d_name : self.logger.ReportFailure("(On display name Checking) || object title = %s ; expected title = %s" %(d_name, dict[field])) else: self.logger.ReportPass("(On display name Checking)") elif field == "startDate": # start date checking startTime = self.item.startTime s_date = "%s/%s/%s" %(startTime.month, startTime.day, startTime.year) if not dict[field] == s_date : self.logger.ReportFailure("(On start date Checking) || object start date = %s ; expected start date = %s" %(s_date, dict[field])) else: self.logger.ReportPass("(On start date Checking)") elif field == "startTime": # start time checking startTime = self.item.startTime s_time = getTime(startTime) if not dict[field] == s_time : self.logger.ReportFailure("(On start time Checking) || object start time = %s ; expected start time = %s" %(s_time, dict[field])) else: self.logger.ReportPass("(On start time Checking)") elif field == "endDate": # end date checking endTime = self.item.endTime e_date = "%s/%s/%s" %(endTime.month, endTime.day, endTime.year) if not dict[field] == e_date : self.logger.ReportFailure("(On end date Checking) || object end date = %s ; expected end date = %s" %(e_date, dict[field])) else: self.logger.ReportPass("(On end date Checking)") elif field == "endTime": # end time checking endTime = self.item.endTime e_time = getTime(endTime) if not dict[field] == e_time : self.logger.ReportFailure("(On end time Checking) || object end time = %s ; expected end time = %s" %(e_time, dict[field])) else: self.logger.ReportPass("(On end time Checking)") elif field == "location": # location checking loc = "%s" %self.item.location if not dict[field] == loc : self.logger.ReportFailure("(On location Checking) || object location = %s ; expected location = %s" %(loc, dict[field])) else: self.logger.ReportPass("(On location Checking)") elif field == "body": # body checking body = "%s" %self.item.bodyString if not dict[field] == body : self.logger.ReportFailure("(On body Checking) || object body = %s ; expected body = %s" %(body, dict[field])) else: self.logger.ReportPass("(On body Checking)") elif field == "fromAddress": # from address checking f = "%s" %self.item.fromAddress if not dict[field] == f : self.logger.ReportFailure("(On from address Checking) || object from address = %s ; expected from address = %s" %(f, dict[field])) else: self.logger.ReportPass("(On from address Checking)") elif field == "toAddress": # to address checking t = "%s" %self.item.toAddress if not dict[field] == t : self.logger.ReportFailure("(On to address Checking) || object to address = %s ; expected to address = %s" %(t, dict[field])) else: self.logger.ReportPass("(On to address Checking)") elif field == "status": # status checking status = "%s" %string.upper(self.item.transparency) if not dict[field] == status : self.logger.ReportFailure("(On status Checking) || object status = %s ; expected status = %s" %(status, dict[field])) else: self.logger.ReportPass("(On status Checking)") elif field == "timeZone": # time zone checking timeZone = "%s" %self.item.startTime.tzname() if not dict[field] == timeZone : self.logger.ReportFailure("(On time zone Checking) || object time zone = %s ; expected time zone = %s" %(timeZone, dict[field])) else: self.logger.ReportPass("(On time zone Checking)") elif field == "alarm": # status checking alarm = self.item.startTime - self.item.reminderTime field = timedelta(minutes = string.atoi(dict[field])) if not field == alarm : self.logger.ReportFailure("(On alarm Checking) || object alarm = %s ; expected alarm = %s" %(alarm, field)) else: self.logger.ReportPass("(On alarm Checking)") elif field == "allDay": # status checking allDay = self.item.allDay if not dict[field] == allDay : self.logger.ReportFailure("(On all Day Checking) || object all day = %s ; expected all day = %s" %(allDay, dict[field])) else: self.logger.ReportPass("(On all Day Checking)") elif field == "stampMail": # Mail stamp checking kind = "%s" %self.item.getKind() if not string.find(kind, "MailMessage") == -1: stampMail = True else: stampMail = False if not dict[field] == stampMail : self.logger.ReportFailure("(On Mail Stamp Checking) || object Mail Stamp = %s ; expected Mail Stamp = %s" %(stampMail, dict[field])) else: self.logger.ReportPass("(On Mail Stamp Checking)") elif field == "stampTask": # Task stamp checking kind = "%s" %self.item.getKind() if not string.find(kind, "Task") == -1: stampTask = True else: stampTask = False if not dict[field] == stampTask : self.logger.ReportFailure("(On Task Stamp Checking) || object Task Stamp = %s ; expected Task Stamp = %s" %(stampTask, dict[field])) else: self.logger.ReportPass("(On Task Stamp Checking)") elif field == "stampEvent": # Event stamp checking kind = "%s" %self.item.getKind() if not string.find(kind, "CalendarEvent") == -1: stampEvent = True else: stampEvent = False if not dict[field] == stampEvent : self.logger.ReportFailure("(On Event Stamp Checking) || object Event Stamp = %s ; expected Event Stamp = %s" %(stampEvent, dict[field])) else: self.logger.ReportPass("(On Event Stamp Checking)") else: # Wrong check => set the report state to unchecked self.logger.SetChecked(False) #report the checkings self.logger.Report("Object state") | 425b34d6e73ece9b541623e89f6e14bd134f1e8f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/425b34d6e73ece9b541623e89f6e14bd134f1e8f/QAUITestAppLib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
67,
921,
12,
2890,
16,
2065,
4672,
3536,
2073,
2665,
460,
635,
5826,
358,
326,
501,
7542,
316,
326,
733,
1677,
632,
723,
2065,
294,
302,
2228,
82,
814,
632,
891,
2065,
294,
302,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2073,
67,
921,
12,
2890,
16,
2065,
4672,
3536,
2073,
2665,
460,
635,
5826,
358,
326,
501,
7542,
316,
326,
733,
1677,
632,
723,
2065,
294,
302,
2228,
82,
814,
632,
891,
2065,
294,
302,
... |
ts.get_available_actions(self.req, | self._ts_get_available_actions(ts, | def test_available_actions_no_perms(self): ts = TicketSystem(self.env) self.req.perm = perm.PermissionCache(self.env) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'new'})) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'assigned'})) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'accepted'})) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'reopened'})) self.assertEqual(['leave'], ts.get_available_actions(self.req, {'status': 'closed'})) | 39d5b6fff4a7b5f237d73c6dfdd3aef15901572d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2831/39d5b6fff4a7b5f237d73c6dfdd3aef15901572d/api.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5699,
67,
4905,
67,
2135,
67,
15969,
12,
2890,
4672,
3742,
273,
22023,
3163,
12,
2890,
18,
3074,
13,
365,
18,
3658,
18,
12160,
273,
4641,
18,
5041,
1649,
12,
2890,
18,
3074,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5699,
67,
4905,
67,
2135,
67,
15969,
12,
2890,
4672,
3742,
273,
22023,
3163,
12,
2890,
18,
3074,
13,
365,
18,
3658,
18,
12160,
273,
4641,
18,
5041,
1649,
12,
2890,
18,
3074,
... |
super(general_ledger_landscape, self).preprocess(objects, data, new_ids) | super(general_ledger_landscape, self).set_context(objects, data, new_ids,report_type) | def preprocess(self, objects, data, ids): ## self.borne_date = self.get_min_date(data['form']) ## new_ids = [] if (data['model'] == 'account.account'): new_ids = ids else: new_ids.append(data['form']['Account_list']) | f250d18b6d9e69e941233e12fa53bba7f4df21ed /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/f250d18b6d9e69e941233e12fa53bba7f4df21ed/general_ledger_landscape.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17942,
12,
2890,
16,
2184,
16,
501,
16,
3258,
4672,
7541,
365,
18,
70,
280,
4644,
67,
712,
273,
365,
18,
588,
67,
1154,
67,
712,
12,
892,
3292,
687,
19486,
7541,
394,
67,
2232,
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,
17942,
12,
2890,
16,
2184,
16,
501,
16,
3258,
4672,
7541,
365,
18,
70,
280,
4644,
67,
712,
273,
365,
18,
588,
67,
1154,
67,
712,
12,
892,
3292,
687,
19486,
7541,
394,
67,
2232,
273,
... |
os.path.join(os.getcwd(), 'sftp_test', 'testfile1')) | os.path.join(os.getcwd(), self.test_dir, 'testfile1')) | def _readLink(_): d = self.client.readLink('testLink') self._emptyBuffers() d.addCallback(self.failUnlessEqual, os.path.join(os.getcwd(), 'sftp_test', 'testfile1')) return d | 72db7f8c9404cd7ecf572677fd09d4f372051152 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/72db7f8c9404cd7ecf572677fd09d4f372051152/test_filetransfer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
2098,
24899,
4672,
302,
273,
365,
18,
2625,
18,
896,
2098,
2668,
3813,
2098,
6134,
365,
6315,
5531,
13699,
1435,
302,
18,
1289,
2428,
12,
2890,
18,
6870,
984,
2656,
5812,
16,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
896,
2098,
24899,
4672,
302,
273,
365,
18,
2625,
18,
896,
2098,
2668,
3813,
2098,
6134,
365,
6315,
5531,
13699,
1435,
302,
18,
1289,
2428,
12,
2890,
18,
6870,
984,
2656,
5812,
16,
... |
ustr.encode(outcodec) | ustr.encode(outcodec, errors) | def append(self, s, charset=None): """Append a string to the MIME header. | f447e64f559d49e6d7077d36b4c07c4eef258424 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/f447e64f559d49e6d7077d36b4c07c4eef258424/Header.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
12,
2890,
16,
272,
16,
4856,
33,
7036,
4672,
3536,
5736,
279,
533,
358,
326,
13195,
1446,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
12,
2890,
16,
272,
16,
4856,
33,
7036,
4672,
3536,
5736,
279,
533,
358,
326,
13195,
1446,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
elif ttype == RPM_INT8: | elif ttype == RPM_INT8 or ttype == RPM_CHAR: | def writeHeader(tags, taghash, region, skip_tags, useinstall, rpmgroup): """Use the data "tags" and change it into a rpmtag header.""" (offset, store, stags1, stags2, stags3) = (0, [], [], [], []) # Sort by number and also first normal tags, then install_keys tags # and at the end the region tag. for tagname in tags.keys(): tagnum = taghash[tagname][0] if tagname == region: stags3.append(tagnum) elif skip_tags and skip_tags.has_key(tagname): pass elif useinstall and install_keys.has_key(tagname): stags2.append(tagnum) else: stags1.append(tagnum) stags1.sort() stags2.sort() stags1.extend(stags2) if 1: stags1.extend(stags3) else: xx = stags1.pop() stags1.extend(stags3) stags1.append(xx) indexdata = [] for tagnum in stags1: tagname = taghash[tagnum][4] value = tags[tagname] ttype = taghash[tagnum][1] count = len(value) pad = 0 if ttype == RPM_ARGSTRING: if isinstance(value, basestring): ttype = RPM_STRING else: ttype = RPM_STRING_ARRAY elif ttype == RPM_GROUP: ttype = RPM_I18NSTRING if rpmgroup: ttype = rpmgroup if ttype == RPM_INT32: if taghash[tagnum][3] & 8: data = pack("!%di" % count, *value) else: data = pack("!%dI" % count, *value) pad = (4 - (offset % 4)) % 4 elif ttype == RPM_STRING: count = 1 data = "%s\x00" % value elif ttype == RPM_STRING_ARRAY or ttype == RPM_I18NSTRING: data = "".join( [ "%s\x00" % value[i] for i in xrange(count) ] ) elif ttype == RPM_BIN: data = value elif ttype == RPM_INT16: data = pack("!%dH" % count, *value) pad = (2 - (offset % 2)) % 2 elif ttype == RPM_INT8: data = pack("!%dB" % count, *value) elif ttype == RPM_INT64: data = pack("!%dQ" % count, *value) pad = (8 - (offset % 8)) % 8 elif ttype == RPM_CHAR: data = pack("!%dc" % count, *value) if pad: offset += pad store.append("\x00" * pad) store.append(data) index = pack("!IIII", tagnum, ttype, offset, count) offset += len(data) if tagname == region: indexdata.insert(0, index) else: indexdata.append(index) indexNo = len(stags1) store = "".join(store) indexdata = "".join(indexdata) return (indexNo, len(store), indexdata, store) | 9d8954635a98e616d42d72e82745fa2d8820963e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/9d8954635a98e616d42d72e82745fa2d8820963e/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
1864,
12,
4156,
16,
1047,
2816,
16,
3020,
16,
2488,
67,
4156,
16,
999,
5425,
16,
25228,
1655,
4672,
3536,
3727,
326,
501,
315,
4156,
6,
471,
2549,
518,
1368,
279,
8715,
1010,
346... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
1864,
12,
4156,
16,
1047,
2816,
16,
3020,
16,
2488,
67,
4156,
16,
999,
5425,
16,
25228,
1655,
4672,
3536,
3727,
326,
501,
315,
4156,
6,
471,
2549,
518,
1368,
279,
8715,
1010,
346... |
width = GetEditorOption("Folding Margin Width", 12) | width = GetEditorOption("Fold Margin Width", 12) | def DoConfigChange(self): SyntEditViewParent.DoConfigChange(self) tabSize = GetEditorOption("Tab Size", 4, 2) indentSize = GetEditorOption("Indent Size", 4, 2) bUseTabs = GetEditorOption("Use Tabs", 0) bSmartTabs = GetEditorOption("Smart Tabs", 1) ext = self.idle.IDLEExtension("AutoIndent") # Required extension. | f5c4b70709b76a90ca24a3a0a12fca2c03903912 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/677/f5c4b70709b76a90ca24a3a0a12fca2c03903912/coloreditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
809,
3043,
12,
2890,
4672,
16455,
496,
4666,
1767,
3054,
18,
3244,
809,
3043,
12,
2890,
13,
3246,
1225,
273,
968,
6946,
1895,
2932,
5661,
6321,
3113,
1059,
16,
576,
13,
3504,
1225,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2256,
809,
3043,
12,
2890,
4672,
16455,
496,
4666,
1767,
3054,
18,
3244,
809,
3043,
12,
2890,
13,
3246,
1225,
273,
968,
6946,
1895,
2932,
5661,
6321,
3113,
1059,
16,
576,
13,
3504,
1225,... |
except KeyboardInterrupt: pass | def flvrec(filename, host='localhost', port=5900, framerate=12, keyframe=120, preferred_encoding=(0,), pwdfile=None, blocksize=32, clipping=None, cmdline=None, debug=0, verbose=1): fp = file(filename, 'wb') if pwdfile: pwdcache = PWDFile(pwdfile) else: pwdcache = PWDCache('%s:%d' % (host,port)) writer = FLVWriter(fp, framerate=framerate, debug=debug) sink = FLVVideoSink(writer, blocksize=blocksize, framerate=framerate, keyframe=keyframe, clipping=clipping, debug=debug) client = RFBNetworkClient(host, port, sink, timeout=500/framerate, pwdcache=pwdcache, preferred_encoding=preferred_encoding, debug=debug) subproc = None try: if cmdline: subproc = subprocess.Popen(cmdline, shell=True) client.open() if verbose: print >>sys.stderr, 'start recording' while 1: client.idle() if verbose: print >>sys.stderr, 'stop recording' except KeyboardInterrupt: pass except socket.error, e: print >>sys.stderr, 'Socket error:', e except RFBError, e: print >>sys.stderr, 'RFB error:', e client.close() writer.close() fp.close() if subproc: os.kill(subproc.pid, signal.SIGINT) return | b1390741a999f5b889219f7c6545520e1d27b22a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11151/b1390741a999f5b889219f7c6545520e1d27b22a/flvrec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
90,
3927,
12,
3459,
16,
1479,
2218,
13014,
2187,
1756,
33,
6162,
713,
16,
21799,
12600,
33,
2138,
16,
30147,
33,
22343,
16,
9119,
67,
5999,
28657,
20,
16,
3631,
14720,
768,
33,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
90,
3927,
12,
3459,
16,
1479,
2218,
13014,
2187,
1756,
33,
6162,
713,
16,
21799,
12600,
33,
2138,
16,
30147,
33,
22343,
16,
9119,
67,
5999,
28657,
20,
16,
3631,
14720,
768,
33,
7... | |
self._update_ob(ob, schema_tool, report_file, report_only) | self._update_ob(portal, ob, schema_tool, report_file, report_only) | def _do_update_on_portal(self, portal, report_file, report_only): print>>report_file, '<h4>%s</h4>' % '/'.join(portal.getPhysicalPath()) schema_tool = portal.portal_schemas self._update_schemas(schema_tool, report_file, report_only) catalog = portal.portal_catalog add_indexes(catalog, report_file, report_only) enable_geotagged_content(portal, report_file, report_only) for brain in catalog(): ob = brain.getObject() if isinstance(ob, NyContentType): self._update_ob(ob, schema_tool, report_file, report_only) | e8785bab14ef44c2158370275d1c1d8fc86597ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3287/e8785bab14ef44c2158370275d1c1d8fc86597ac/update_geotagged_content.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
2725,
67,
265,
67,
24386,
12,
2890,
16,
11899,
16,
2605,
67,
768,
16,
2605,
67,
3700,
4672,
1172,
9778,
6006,
67,
768,
16,
2368,
76,
24,
9822,
87,
1757,
76,
24,
1870,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
2725,
67,
265,
67,
24386,
12,
2890,
16,
11899,
16,
2605,
67,
768,
16,
2605,
67,
3700,
4672,
1172,
9778,
6006,
67,
768,
16,
2368,
76,
24,
9822,
87,
1757,
76,
24,
1870,
... |
help['base'] = 'Convert numbers between bases (radixes)' | help['base'] = u'Convert numbers between bases (radixes)' | def calculate(self, event, expression): for term in self.banned: if term in expression: return | 02d9964506ae03a63536a30f1b07453e58027d69 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12048/02d9964506ae03a63536a30f1b07453e58027d69/math.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
12,
2890,
16,
871,
16,
2652,
4672,
364,
2481,
316,
365,
18,
70,
10041,
30,
309,
2481,
316,
2652,
30,
327,
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,
4604,
12,
2890,
16,
871,
16,
2652,
4672,
364,
2481,
316,
365,
18,
70,
10041,
30,
309,
2481,
316,
2652,
30,
327,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
ColormapChangeMask = (1L<<23) | ColormapChangeMask = (1L<<23) | def fl_get_real_object_window(ob): """ fl_get_real_object_window(ob) -> window """ retval = _fl_get_real_object_window(ob) return retval | 9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
7688,
67,
1612,
67,
5668,
12,
947,
4672,
3536,
1183,
67,
588,
67,
7688,
67,
1612,
67,
5668,
12,
947,
13,
317,
2742,
3536,
225,
5221,
273,
389,
2242,
67,
588,
67,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
588,
67,
7688,
67,
1612,
67,
5668,
12,
947,
4672,
3536,
1183,
67,
588,
67,
7688,
67,
1612,
67,
5668,
12,
947,
13,
317,
2742,
3536,
225,
5221,
273,
389,
2242,
67,
588,
67,
... |
sage: subsets([1,2,3]) | sage: subsets([1,2,3]) | def powerset(X): r""" Iterator over the \emph{list} of all subsets of the iterable X, in no particular order. Each list appears exactly once, up to order. INPUT: X -- an iterable OUTPUT: iterator of lists EXAMPLES: sage: list(powerset([1,2,3])) [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3]] sage: [z for z in powerset([0,[1,2]])] [[], [0], [[1, 2]], [0, [1, 2]]] Iterating over the power set of an infinite set is also allowed: sage: i = 0 sage: for x in powerset(ZZ): ... if i > 10: ... break ... else: ... i += 1 ... print x, [] [0] [1] [0, 1] [-1] [0, -1] [1, -1] [0, 1, -1] [2] [0, 2] [1, 2] You may also use subsets as an alias for powerset: sage: subsets([1,2,3]) <generator object at 0xaeae418c> sage: list(subsets([1,2,3])) [[], [1], [2], [1, 2], [3], [1, 3], [2, 3], [1, 2, 3]] \begin{notice} The reason we return lists instead of sets is that the elements of sets must be hashable and many structures on which one wants the powerset consist of non-hashable objects. \end{notice} AUTHORS: -- William Stein -- Nils Bruin (2006-12-19): rewrite to work for not-necessarily finite objects X. """ yield [] pairs = [] for x in X: pairs.append((2**len(pairs),x)) for w in xrange(2**(len(pairs)-1), 2**(len(pairs))): yield [x for m, x in pairs if m & w] | 2d06c0aedac01f63e7e569360b407e284d7c7358 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/2d06c0aedac01f63e7e569360b407e284d7c7358/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7602,
21686,
12,
60,
4672,
436,
8395,
4498,
1879,
326,
521,
351,
844,
95,
1098,
97,
434,
777,
30760,
434,
326,
6087,
1139,
16,
316,
1158,
6826,
1353,
18,
225,
8315,
666,
14606,
8950,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7602,
21686,
12,
60,
4672,
436,
8395,
4498,
1879,
326,
521,
351,
844,
95,
1098,
97,
434,
777,
30760,
434,
326,
6087,
1139,
16,
316,
1158,
6826,
1353,
18,
225,
8315,
666,
14606,
8950,
3... |
raise Sorry("Final number of reflections > number of reflections: %d > %d" % (final_n_ref_first, d_spacings.size())) print >> log, " Number of resolution zones: %d" % number_of_zones | print >> log, """\ WARNING: Final number of reflections for first resolution zone is greater than the number of available reflections (%d > %d). INFO: Number of resolution zones reset to 1.""" % ( final_n_ref_first, d_spacings.size()) | def split_resolution_range( d_spacings, n_bodies, n_ref_first, multi_body_factor_n_ref_first, d_low, d_high, number_of_zones, zone_exp_factor, log = None): assert n_bodies > 0 assert multi_body_factor_n_ref_first is None or multi_body_factor_n_ref_first > 0 assert n_ref_first is None or n_ref_first > 0 assert d_low is None or d_low > 0 assert d_high is None or d_high > 0 assert n_ref_first is not None or d_low is not None if (d_low is not None and d_high is not None): assert d_low > d_high assert number_of_zones is None or number_of_zones > 0 assert zone_exp_factor > 0 if (log is None): log = sys.stdout n_refl_data = d_spacings.size() d_spacings = d_spacings.select( flex.sort_permutation(d_spacings, reverse = True)) d_max, d_min = d_spacings[0], d_spacings[-1] if (d_high is not None and d_min < d_high): d_spacings = d_spacings.select(d_spacings >= d_high) d_high = d_spacings[-1] m_ref_first = n_ref_first if (n_ref_first is None): final_n_ref_first = (d_spacings >= d_low).count(True) else: if (multi_body_factor_n_ref_first is not None): m_ref_first += iround( m_ref_first * (n_bodies-1) * multi_body_factor_n_ref_first) assert m_ref_first > 0 if ( d_low is not None and m_ref_first <= d_spacings.size() and d_spacings[m_ref_first-1] > d_low): final_n_ref_first = (d_spacings >= d_low).count(True) else: final_n_ref_first = m_ref_first d_mins = [] if (number_of_zones is not None and number_of_zones > 1): degenerate = final_n_ref_first > d_spacings.size() if (not degenerate): f = math.pow( d_spacings.size()/final_n_ref_first, 1/((number_of_zones-1)*zone_exp_factor)) d_mins.append(d_spacings[final_n_ref_first-1]) for i_zone in range(1, number_of_zones): n = iround(final_n_ref_first * f**(i_zone*zone_exp_factor)) if (i_zone == number_of_zones - 1): assert n == d_spacings.size() # sanity check d_mins.append(d_spacings[n-1]) else: final_n_ref_first = min(final_n_ref_first, d_spacings.size()) degenerate = False d_mins.append(d_high) print >> log, "Rigid body refinement:" if (len(d_mins) > 1 or degenerate): print >> log, " Calculation for first resolution zone:" print >> log, " Requested number of reflections per body:", n_ref_first print >> log, " Requested factor per body:", \ multi_body_factor_n_ref_first print >> log, " Number of bodies:", n_bodies print >> log, " Resulting number of reflections:", m_ref_first print >> log, " Requested low-resolution limit:", d_low, if (final_n_ref_first != m_ref_first): print >> log, "(determines final number)", print >> log print >> log, " Final number of reflections:", final_n_ref_first print >> log, " Data resolution: %6.2f - %6.2f" \ " (%d reflections)" % (d_max, d_min, n_refl_data) print >> log, " Resolution for rigid body refinement: %6.2f - %6.2f" \ " (%d reflections)" % (d_max, d_high, d_spacings.size()) if (degenerate): raise Sorry("Final number of reflections > number of reflections: %d > %d" % (final_n_ref_first, d_spacings.size())) print >> log, " Number of resolution zones: %d" % number_of_zones if (len(d_mins) > 1): print >> log, " Resolution cutoffs for multiple zones: " print >> log, " number of" print >> log, " zone resolution reflections" for i, d_i in enumerate(d_mins): n_ref = (d_spacings >= d_i).count(True) print >> log, " %3d %6.2f -%6.2f %11d" % ( i+1, d_max, d_i, n_ref) return d_mins | b10578fa116e23726f8619225eeef0c075f5a11f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/696/b10578fa116e23726f8619225eeef0c075f5a11f/rigid_body.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1416,
67,
19182,
67,
3676,
12,
302,
67,
1752,
1077,
899,
16,
290,
67,
70,
18134,
16,
290,
67,
1734,
67,
3645,
16,
3309,
67,
3432,
67,
6812,
67,
82,
67,
1734,
67,
3645,
16,
302,
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,
1416,
67,
19182,
67,
3676,
12,
302,
67,
1752,
1077,
899,
16,
290,
67,
70,
18134,
16,
290,
67,
1734,
67,
3645,
16,
3309,
67,
3432,
67,
6812,
67,
82,
67,
1734,
67,
3645,
16,
302,
67,... |
env[key] += ',' + value | if 'COOKIE' in key: env[key] += '; ' + value else: env[key] += ',' + value | def get_environ(self): env = self.server.get_environ() env['REQUEST_METHOD'] = self.command env['SCRIPT_NAME'] = '' | e81637eb8f7043ceaa4057d2498bd12cdf084301 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10423/e81637eb8f7043ceaa4057d2498bd12cdf084301/pywsgi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
28684,
12,
2890,
4672,
1550,
273,
365,
18,
3567,
18,
588,
67,
28684,
1435,
1550,
3292,
5519,
67,
5327,
3546,
273,
365,
18,
3076,
1550,
3292,
10885,
67,
1985,
3546,
273,
875,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
28684,
12,
2890,
4672,
1550,
273,
365,
18,
3567,
18,
588,
67,
28684,
1435,
1550,
3292,
5519,
67,
5327,
3546,
273,
365,
18,
3076,
1550,
3292,
10885,
67,
1985,
3546,
273,
875,
2... |
if kwargs["tix"] is None: raise ModelError("Need to specify tix in order to calculate 2nd order perturbation!") else: tix = kwargs["tix"] fotix = np.around((t - self.second_stage.simtstart)/self.second_stage.tstep_wanted) | fotix = np.int(np.around((t - self.second_stage.simtstart)/self.second_stage.tstep_wanted)) | def derivs(self, y, t, **kwargs): """Equation of motion for second order perturbations including source term""" self._log.debug("args: %s", str(kwargs)) #If k not given select all if "k" not in kwargs or kwargs["k"] is None: k = self.k kix = np.arange(len(k)) else: k = kwargs["k"] kix = kwargs["kix"] if kix is None: raise ModelError("Need to specify kix in order to calculate 2nd order perturbation!") #Need t index to use first order data if kwargs["tix"] is None: raise ModelError("Need to specify tix in order to calculate 2nd order perturbation!") else: tix = kwargs["tix"] fotix = np.around((t - self.second_stage.simtstart)/self.second_stage.tstep_wanted) #debug logging self._log.debug("tix=%f, t=%f, fo.tresult[tix]=%f, fotix=%f", tix, t, self.second_stage.tresult[tix], fotix) #Get first order results for this time step fovars = self.second_stage.yresult[tix].copy()[:,kix] phi, phidot, H = fovars[0:3] epsilon = self.second_stage.bgepsilon[tix] #Get source terms src = self.source[tix][kix] srcreal, srcimag = src.real, src.imag #get potential from function U, dU, d2U, d3U = self.potentials(fovars, self.pot_params)[0:4] #Set derivatives taking care of k type if type(k) is np.ndarray or type(k) is list: dydx = np.zeros((4,len(k))) else: dydx = np.zeros(4) #Get a a = self.ainit*np.exp(t) #Real parts #d\deltaphi_2/dn = y[1] dydx[0] = y[1] #d\deltaphi_2^prime/dn # dydx[1] = (-(3 - epsilon)*y[1] - ((k/(a*H))**2)*y[0] -(d2U/H**2 - 3*(phidot**2))*y[0] - srcreal) #Complex \deltaphi_2 dydx[2] = y[3] #Complex derivative dydx[3] = (-(3 - epsilon)*y[3] - ((k/(a*H))**2)*y[2] -(d2U/H**2 - 3*(phidot**2))*y[2] - srcimag) return dydx | 92497b2747f77c97a04eeaadb1caa1b1ce25f30d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7283/92497b2747f77c97a04eeaadb1caa1b1ce25f30d/cosmomodels.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9630,
87,
12,
2890,
16,
677,
16,
268,
16,
2826,
4333,
4672,
3536,
13142,
367,
434,
21188,
364,
2205,
1353,
24445,
15850,
1012,
6508,
1084,
2481,
8395,
365,
6315,
1330,
18,
4148,
2932,
19... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9630,
87,
12,
2890,
16,
677,
16,
268,
16,
2826,
4333,
4672,
3536,
13142,
367,
434,
21188,
364,
2205,
1353,
24445,
15850,
1012,
6508,
1084,
2481,
8395,
365,
6315,
1330,
18,
4148,
2932,
19... |
f.close() s = ''.join(s) | def verify_revision(uuid, host, path, rev): tmp = tempfile.mkdtemp(suffix='_flyback') os.chdir(tmp) git_dir = get_git_dir(uuid, host, path) git_cmd = 'GIT_DIR="%s" GIT_WORK_TREE="%s" git ' % (git_dir,tmp) cmd = git_cmd + 'archive %s > /dev/null' % (rev) print '$', cmd f = os.popen(cmd) s = [] for line in f: s.append(line) sys.stdout.write(line) f.close() s = ''.join(s) rmdir(tmp) os.chdir(util.RUN_FROM_DIR) # save verification history print 1 try: f = open( os.path.join(git_dir, 'revision_verifications.pickle'), 'rb' ) revision_verifications = pickle.load(f) print 2 f.close() except: revision_verifications = {} print 3 revision_verifications[rev] = datetime.datetime.now() f = open( os.path.join(git_dir, 'revision_verifications.pickle'), 'wb' ) pickle.dump(revision_verifications,f) f.close() print 4 | 98e5692cfc93ab3e1d7d2bba4eda41be3c6ae924 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/317/98e5692cfc93ab3e1d7d2bba4eda41be3c6ae924/backup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3929,
67,
13057,
12,
7080,
16,
1479,
16,
589,
16,
5588,
4672,
1853,
273,
13275,
18,
24816,
72,
5814,
12,
8477,
2218,
67,
29670,
823,
6134,
1140,
18,
343,
1214,
12,
5645,
13,
5071,
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,
3929,
67,
13057,
12,
7080,
16,
1479,
16,
589,
16,
5588,
4672,
1853,
273,
13275,
18,
24816,
72,
5814,
12,
8477,
2218,
67,
29670,
823,
6134,
1140,
18,
343,
1214,
12,
5645,
13,
5071,
67,
... | |
article_text = self.strip_templates(article_text) | def get_wikitext(self, title): wikidb = WPWikiDB() article_text = wikidb.getRawArticle(title) # Pass ?noexpand=1 in the url to disable template expansion. if self.params.get('noexpand', 0): article_text = wikidb.getRawArticle(title) article_text = self.strip_templates(article_text) else: article_text = wikidb.getExpandedArticle(title) | 47115b71ec50ef07a5cd96a4a67229228362a0a9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6694/47115b71ec50ef07a5cd96a4a67229228362a0a9/server.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
11999,
305,
408,
12,
2890,
16,
2077,
4672,
341,
1766,
350,
70,
273,
10614,
25438,
2290,
1435,
7559,
67,
955,
273,
341,
1766,
350,
70,
18,
588,
4809,
7880,
12,
2649,
13,
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,
336,
67,
11999,
305,
408,
12,
2890,
16,
2077,
4672,
341,
1766,
350,
70,
273,
10614,
25438,
2290,
1435,
7559,
67,
955,
273,
341,
1766,
350,
70,
18,
588,
4809,
7880,
12,
2649,
13,
225,
... | |
query = NotQuery(PhraseQuery('data', 'lion')) | query = NotQuery(PhraseQuery('data', u'lion')) | def test_everything(self): catalog = Catalog('tests/catalog', Document.fields) # Simple Search, hit results = catalog.search(data=u'lion') self.assertEqual(len(results), 4) documents = [ x.abspath for x in results.get_documents(sort_by='abspath') ] self.assertEqual(documents, ['03.txt', '08.txt', '10.txt', '23.txt']) # Simple Search, miss self.assertEqual(len(catalog.search(data=u'tiger')), 0) # Unindex, Search, Abort, Search catalog.unindex_document('03.txt') results = catalog.search(data=u'lion') self.assertEqual(len(catalog.search(data=u'lion')), 3) catalog.abort_changes() self.assertEqual(len(catalog.search(data=u'lion')), 4) # Query on indexed boolean self.assertEqual(len(catalog.search(about_wolf=True)), 5) # Query on stored boolean results = catalog.search(about_wolf=True) longer_stories = 0 for result in results.get_documents(): if result.is_long: longer_stories += 1 self.assertEqual(longer_stories, 0) # Phrase Query results = catalog.search(data=u'this is a double death') self.assertEqual(len(results), 1) # Range Query query = RangeQuery('abspath', '03.txt', '06.txt') results = catalog.search(query) self.assertEqual(len(results), 4) # Not Query (1/2) query = NotQuery(PhraseQuery('data', 'lion')) results = catalog.search(query) self.assertEqual(len(results), 27) # Not Query (2/2) query1 = PhraseQuery('data', 'mouse') query2 = NotQuery(PhraseQuery('data', 'lion')) query = AndQuery(query1, query2) results = catalog.search(query) self.assertEqual(len(results), 2) | 14fb7ac2b9c81b0005377ac783ef8e7853570d7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12681/14fb7ac2b9c81b0005377ac783ef8e7853570d7b/test_database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
20434,
4274,
12,
2890,
4672,
6222,
273,
14953,
2668,
16341,
19,
7199,
2187,
4319,
18,
2821,
13,
468,
4477,
5167,
16,
6800,
1686,
273,
6222,
18,
3072,
12,
892,
33,
89,
11,
80,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
20434,
4274,
12,
2890,
4672,
6222,
273,
14953,
2668,
16341,
19,
7199,
2187,
4319,
18,
2821,
13,
468,
4477,
5167,
16,
6800,
1686,
273,
6222,
18,
3072,
12,
892,
33,
89,
11,
80,... |
if self.blockItem.doSelectWeek: style |= wx.minical.CAL_HIGHLIGHT_WEEK | calendarButton = Block.Block.findBlockByName("ApplicationBarEventButton") try: if calendarButton.selected and self.blockItem.doSelectWeek: style |= wx.minical.CAL_HIGHLIGHT_WEEK except AttributeError: pass | def wxSynchronizeWidget(self): style = wx.minical.CAL_SUNDAY_FIRST | wx.minical.CAL_SHOW_SURROUNDING_WEEKS if '__WXMAC__' in wx.PlatformInfo: style |= wx.BORDER_SIMPLE else: style |= wx.BORDER_STATIC if self.blockItem.doSelectWeek: style |= wx.minical.CAL_HIGHLIGHT_WEEK self.SetWindowStyle(style) | 574a29e53e327a094262417e714d9add3ddb71c4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/574a29e53e327a094262417e714d9add3ddb71c4/CalendarBlocks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7075,
19298,
554,
4609,
12,
2890,
4672,
2154,
273,
7075,
18,
1154,
1706,
18,
7913,
67,
55,
5240,
5255,
67,
15354,
571,
7075,
18,
1154,
1706,
18,
7913,
67,
16677,
67,
26397,
15092,
1360,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7075,
19298,
554,
4609,
12,
2890,
4672,
2154,
273,
7075,
18,
1154,
1706,
18,
7913,
67,
55,
5240,
5255,
67,
15354,
571,
7075,
18,
1154,
1706,
18,
7913,
67,
16677,
67,
26397,
15092,
1360,
... |
MultiContentEntryText(pos = (2, 2), size = (290, 22), flags = RT_HALIGN_LEFT, text = 1), | MultiContentEntryText(pos = (0, 0), size = (550, 30), font=0, flags = RT_HALIGN_LEFT, text = 0), MultiContentEntryText(pos = (0, 30), size = (175, 20), font=1, flags = RT_HALIGN_LEFT, text = 5), MultiContentEntryText(pos = (175, 30), size = (175, 20), font=1, flags = RT_HALIGN_LEFT, text = 4), MultiContentEntryText(pos = (350, 0), size = (200, 20), font=1, flags = RT_HALIGN_LEFT, text = 2), MultiContentEntryText(pos = (350, 30), size = (200, 20), font=1, flags = RT_HALIGN_LEFT, text = 3), MultiContentEntryPixmapAlphaTest(pos = (0, 52), size = (550, 2), png = 6), | def load_cache(cache_file): #Does a cPickle load fd = open(cache_file) cache_data = load(fd) fd.close() return cache_data | e198493e29c22e49dff1da47e83a989cdbd1d913 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/e198493e29c22e49dff1da47e83a989cdbd1d913/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
2493,
12,
2493,
67,
768,
4672,
468,
10154,
279,
276,
17968,
298,
1262,
5194,
273,
1696,
12,
2493,
67,
768,
13,
1247,
67,
892,
273,
1262,
12,
8313,
13,
5194,
18,
4412,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1262,
67,
2493,
12,
2493,
67,
768,
4672,
468,
10154,
279,
276,
17968,
298,
1262,
5194,
273,
1696,
12,
2493,
67,
768,
13,
1247,
67,
892,
273,
1262,
12,
8313,
13,
5194,
18,
4412,
1435,
... |
filename = Uri2Filename(self.filenames[0]) pkg.filename = filename + "/" + props["href"] elif name == "size": props = getProps(reader) pkg.sig["size_in_sig"][0] += int(props.get("package", "0")) | pkg.filename = self.filename + "/" + props["href"] | def __parsePackage(self, reader): Readf = reader.Read NodeTypef = reader.NodeType Namef = reader.Name pkg = ReadRpm("repopkg") pkg.sig = HdrIndex() pkg.hdr = HdrIndex() pkg.setHdr() pkg.sig["size_in_sig"] = [0,] while Readf() == 1: ntype = NodeTypef() if ntype == TYPE_END_ELEMENT: if Namef() == "package": break continue if ntype != TYPE_ELEMENT: continue name = Namef() if name == "name": Readf() pkg["name"] = reader.Value() elif name == "arch": Readf() pkg["arch"] = reader.Value() if pkg["arch"] == "src": pkg.issrc = 1 else: pkg["sourcerpm"] = "" elif name == "version": props = getProps(reader) pkg["version"] = props["ver"] pkg["release"] = props["rel"] pkg["epoch"] = [int(props["epoch"]),] elif name == "checksum": props = getProps(reader) if props["type"] == "md5": Readf() pkg.sig["md5"] = reader.Value() elif props["type"] == "sha": Readf() pkg.sig["sha1header"] = reader.Value() elif name == "location": props = getProps(reader) filename = Uri2Filename(self.filenames[0]) pkg.filename = filename + "/" + props["href"] elif name == "size": props = getProps(reader) pkg.sig["size_in_sig"][0] += int(props.get("package", "0")) elif name == "format": self.__parseFormat(reader, pkg) #elif name in ("summary", "description", "packager", "url", "time"): # pass #else: # print name return pkg | 427871e48b993cbe1bec0e26f0693386c8014c95 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/427871e48b993cbe1bec0e26f0693386c8014c95/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2670,
2261,
12,
2890,
16,
2949,
4672,
2720,
74,
273,
2949,
18,
1994,
20896,
74,
273,
2949,
18,
15101,
1770,
74,
273,
2949,
18,
461,
3475,
273,
2720,
54,
7755,
2932,
266,
5120,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2670,
2261,
12,
2890,
16,
2949,
4672,
2720,
74,
273,
2949,
18,
1994,
20896,
74,
273,
2949,
18,
15101,
1770,
74,
273,
2949,
18,
461,
3475,
273,
2720,
54,
7755,
2932,
266,
5120,
14... |
set = HitList() | set = HitSet() | def search_in_bibxxx(p, f, type): """Searches for pattern 'p' inside bibxxx tables for field 'f' and returns hitlist of recIDs found. The search type is defined by 'type' (e.g. equals to 'r' for a regexp search).""" p_orig = p # saving for eventual future 'no match' reporting # wash arguments: f = string.replace(f, '*', '%') # replace truncation char '*' in field definition if type == 'r': pattern = "REGEXP '%s'" % MySQLdb.escape_string(p) else: p = string.replace(p, '*', '%') # we now use '*' as the truncation character ps = string.split(p, "->", 1) # check for span query: if len(ps) == 2: pattern = "BETWEEN '%s' AND '%s'" % (MySQLdb.escape_string(ps[0]), MySQLdb.escape_string(ps[1])) else: if string.find(p, '%') > -1: pattern = "LIKE '%s'" % MySQLdb.escape_string(ps[0]) else: pattern = "='%s'" % MySQLdb.escape_string(ps[0]) # construct 'tl' which defines the tag list (MARC tags) to search in: tl = [] if str(f[0]).isdigit() and str(f[1]).isdigit(): tl.append(f) # 'f' seems to be okay as it starts by two digits else: # convert old ALEPH tag names, if appropriate: (TODO: get rid of this before entering this function) if cfg_fields_convert.has_key(string.lower(f)): f = cfg_fields_convert[string.lower(f)] # deduce desired MARC tags on the basis of chosen 'f' tl = get_field_tags(f) if not tl: # by default we are searching in author index: tl = get_field_tags("author") # okay, start search: l = [] # will hold list of recID that matched for t in tl: # deduce into which bibxxx table we will search: digit1, digit2 = int(t[0]), int(t[1]) bx = "bib%d%dx" % (digit1, digit2) bibx = "bibrec_bib%d%dx" % (digit1, digit2) # construct query: if t == "001": query = "SELECT id FROM bibrec WHERE id %s" % pattern else: if len(t) != 6 or t[-1:]=='%': # only the beginning of field 't' is defined, so add wildcard character: query = "SELECT bibx.id_bibrec FROM %s AS bx LEFT JOIN %s AS bibx ON bx.id=bibx.id_bibxxx WHERE bx.value %s AND bx.tag LIKE '%s%%'" %\ (bx, bibx, pattern, t) else: query = "SELECT bibx.id_bibrec FROM %s AS bx LEFT JOIN %s AS bibx ON bx.id=bibx.id_bibxxx WHERE bx.value %s AND bx.tag='%s'" %\ (bx, bibx, pattern, t) # launch the query: res = run_sql(query) # fill the result set: for id_bibrec in res: if id_bibrec[0]: l.append(id_bibrec[0]) # check no of hits found: nb_hits = len(l) # okay, return result set: set = HitList() set.addlist(Numeric.array(l)) return set | f89feb7ea51a59100f9e1291d3f34cbf65a4ba8b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/f89feb7ea51a59100f9e1291d3f34cbf65a4ba8b/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
267,
67,
70,
495,
18310,
12,
84,
16,
284,
16,
618,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
4832,
25581,
18310,
4606,
364,
652,
296,
74,
11,
471,
1135,
6800,
1098,
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... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1623,
67,
267,
67,
70,
495,
18310,
12,
84,
16,
284,
16,
618,
4672,
3536,
16294,
364,
1936,
296,
84,
11,
4832,
25581,
18310,
4606,
364,
652,
296,
74,
11,
471,
1135,
6800,
1098,
434,
1... |
def init(self): self.__window = window.pidawindow(self) self.__window.connect('destroy', self.cb_destroy) | def cb_destroy(self, window): self.boss.stop() def _create_uim(self): | def init(self): self.__window = window.pidawindow(self) self.__window.connect('destroy', self.cb_destroy) self.__uim = gtk.UIManager() ag = gtk.ActionGroup('baseactions') ag.add_actions([ ('base_file_menu', None, '_File'), ('base_edit_menu', None, '_Edit'), ('base_project_menu', None, '_Project'), ('base_python_menu', None, '_Python'), ('base_tools_menu', None, '_Tools'), ('base_help_menu', None, '_Help') ]) menudef = """ <menubar> <menu name="base_file" action="base_file_menu"> <placeholder name="OpenFileMenu" /> <placeholder name="SaveFileMenu" /> <placeholder name="ExtrasFileMenu" /> <placeholder name="GlobalFileMenu" /> </menu> <menu name="base_edit" action="base_edit_menu"> </menu> <menu name="base_project" action="base_project_menu"> </menu> <menu name="base_python" action="base_python_menu"> </menu> <menu name="base_tools" action="base_tools_menu"> </menu> <menu name="base_help" action="base_help_menu"> </menu> </menubar> <toolbar> <placeholder name="OpenFileToolbar"> </placeholder> <placeholder name="SaveFileToolbar"> </placeholder> <placeholder name="EditToolbar"> </placeholder> <placeholder name="ProjectToolbar"> </placeholder> <placeholder name="VcToolbar"> </placeholder> </toolbar> """ self.call('register_action_group', actiongroup=ag, uidefinition=menudef) | 190dc150e9d2689725c1b03d2ade0026a8222714 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2233/190dc150e9d2689725c1b03d2ade0026a8222714/window.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
11662,
12,
2890,
16,
2742,
4672,
365,
18,
70,
8464,
18,
5681,
1435,
225,
1652,
389,
2640,
67,
89,
381,
12,
2890,
4672,
365,
16186,
89,
381,
273,
22718,
18,
5370,
1318,
1435,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2875,
67,
11662,
12,
2890,
16,
2742,
4672,
365,
18,
70,
8464,
18,
5681,
1435,
225,
1652,
389,
2640,
67,
89,
381,
12,
2890,
4672,
365,
16186,
89,
381,
273,
22718,
18,
5370,
1318,
1435,
... |
self.running_time = re.search(r"/images/flag_[\d]+.gif[^>].*/table>.*<br>.* <br>[^,]+,[^,]*,[^\d]*([\d]+)",self.page) | self.running_time = re.search(r"<br>\s+<b>\s+([^&]+) <br>([^,]+),\s+(\d+),\s+(\d+)\s+min[^<]*</b><BR><BR><b>Re",self.page) | def running_time(self): self.running_time = re.search(r"/images/flag_[\d]+.gif[^>].*/table>.*<br>.* <br>[^,]+,[^,]*,[^\d]*([\d]+)",self.page) if self.running_time: self.running_time = gutils.strip_tags(self.running_time.group(1)) else: self.running_time = "" | a15c986268b8505d4a169f8d3d399848647f3c0b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2687/a15c986268b8505d4a169f8d3d399848647f3c0b/PluginMovieCSFD.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3549,
67,
957,
12,
2890,
4672,
365,
18,
8704,
67,
957,
273,
283,
18,
3072,
12,
86,
6,
32,
2848,
5333,
87,
15,
32,
70,
5333,
87,
15,
8178,
10,
7941,
10,
10600,
31,
32,
2848,
34,
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,
3549,
67,
957,
12,
2890,
4672,
365,
18,
8704,
67,
957,
273,
283,
18,
3072,
12,
86,
6,
32,
2848,
5333,
87,
15,
32,
70,
5333,
87,
15,
8178,
10,
7941,
10,
10600,
31,
32,
2848,
34,
8... |
matches.append(s.GetFieldValuesTuple()) | matches.append(StopToTuple(s)) | def handle_json_GET_stopsearch(self, params): schedule = self.server.schedule query = params.get('q', None).lower() matches = [] for s in schedule.GetStopList(): if s.stop_id.lower().find(query) != -1 or s.stop_name.lower().find(query) != -1: matches.append(s.GetFieldValuesTuple()) return matches | bbed61a6c3ce55d4ad72ab808f8d47c00db2e948 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6302/bbed61a6c3ce55d4ad72ab808f8d47c00db2e948/schedule_viewer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1977,
67,
3264,
67,
5681,
3072,
12,
2890,
16,
859,
4672,
4788,
273,
365,
18,
3567,
18,
10676,
843,
273,
859,
18,
588,
2668,
85,
2187,
599,
2934,
8167,
1435,
1885,
273,
5378,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
67,
1977,
67,
3264,
67,
5681,
3072,
12,
2890,
16,
859,
4672,
4788,
273,
365,
18,
3567,
18,
10676,
843,
273,
859,
18,
588,
2668,
85,
2187,
599,
2934,
8167,
1435,
1885,
273,
5378,
... |
def __init__(self, schema, descr=u'', name=''): Group.__init__(self, schema, descr, name) | def __init__(self, schema, desc=u'', name=''): Group.__init__(self, schema, desc, name) | def __init__(self, schema, descr=u'', name=''): Group.__init__(self, schema, descr, name) self._filename = '' self._bad_lines = [] | 513f97ca83b44ea792b8e169cb28ed0b3e8c402e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11722/513f97ca83b44ea792b8e169cb28ed0b3e8c402e/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1963,
16,
3044,
33,
89,
11,
2187,
508,
2218,
11,
4672,
3756,
16186,
2738,
972,
12,
2890,
16,
1963,
16,
3044,
16,
508,
13,
365,
6315,
3459,
273,
875,
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,
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,
1963,
16,
3044,
33,
89,
11,
2187,
508,
2218,
11,
4672,
3756,
16186,
2738,
972,
12,
2890,
16,
1963,
16,
3044,
16,
508,
13,
365,
6315,
3459,
273,
875,
36... |
print "running resolvconf" p = misc.Run(' '.join([self.resolvconf_cmd, '-a', self.iface]), include_stderr=True, return_obj=True) p.communicate(input=resolv_params)[0] | cmd = [self.resolvconf_cmd, '-a', self.iface] if self.verbose: print cmd p = misc.Run(cmd, include_stderr=True, return_obj=True) p.communicate(input=resolv_params) | def SetDNS(self, dns1=None, dns2=None, dns3=None, dns_dom=None, search_dom=None): """ Set the DNS of the system to the specified DNS servers. | a38f5e6c786c3bf30187ad8629128dd232ca4b88 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/353/a38f5e6c786c3bf30187ad8629128dd232ca4b88/wnettools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
11602,
12,
2890,
16,
6605,
21,
33,
7036,
16,
6605,
22,
33,
7036,
16,
6605,
23,
33,
7036,
16,
6605,
67,
9859,
33,
7036,
16,
1623,
67,
9859,
33,
7036,
4672,
3536,
1000,
326,
8858... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1000,
11602,
12,
2890,
16,
6605,
21,
33,
7036,
16,
6605,
22,
33,
7036,
16,
6605,
23,
33,
7036,
16,
6605,
67,
9859,
33,
7036,
16,
1623,
67,
9859,
33,
7036,
4672,
3536,
1000,
326,
8858... |
this = apply(_quickfix.new_LastUpdateTime, args) | this = _quickfix.new_LastUpdateTime(*args) | def __init__(self, *args): this = apply(_quickfix.new_LastUpdateTime, 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,
3024,
1891,
950,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
3024,
1891,
950,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
3... |
self._menbar.GetRemoveMenu().Bind(wx.EVT_MENU_OPEN, self.OnMenuOpen) self._menbar.GetSavedMenu().Bind(wx.EVT_MENU_OPEN, self.OnMenuOpen) | def __init__(self, parent, id, pos=wx.DefaultPosition, size=wx.DefaultSize, style=wx.NO_BORDER): wx.Panel.__init__(self, parent, id, pos, size, style) # Attributes self._sizer = wx.BoxSizer(wx.VERTICAL) ff = "".join(syntax.syntax.GenFileFilters()) self._context = None self._menbar = BrowserMenuBar(self, self.ID_BROWSE_MENU) self._browser = FileBrowser(self, ID_FILEBROWSE, dir = wx.GetHomeDir(), size = (200,-1), style = wx.DIRCTRL_SHOW_FILTERS | wx.BORDER_SUNKEN, filter = ff) self._config = PathMarkConfig(ed_glob.CONFIG['CACHE_DIR']) for item in self._config.GetItemLabels(): self._menbar.AddItem(item) self._showh_cb = wx.CheckBox(self, self.ID_SHOW_HIDDEN, _("Show Hidden Files")) self._showh_cb.SetValue(False) | e90e499ee5b7bec434002466ca98e8c18ca9a363 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3530/e90e499ee5b7bec434002466ca98e8c18ca9a363/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
612,
16,
949,
33,
27226,
18,
1868,
2555,
16,
963,
33,
27226,
18,
1868,
1225,
16,
2154,
33,
27226,
18,
3417,
67,
38,
7954,
4672,
7075,
18,
5537... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
982,
16,
612,
16,
949,
33,
27226,
18,
1868,
2555,
16,
963,
33,
27226,
18,
1868,
1225,
16,
2154,
33,
27226,
18,
3417,
67,
38,
7954,
4672,
7075,
18,
5537... | |
print "form_parms already has %s -> %s" % (name,self.form_parms[name]) | def const_selector(self,description,name,keys,values,**options): combobox = gtk.combo_box_new_text() combobox.set_data('name',name) idx = len(values) for v in values: combobox.append_text(v) try: if self.form_parms[name]==v: print "form_parms already has %s -> %s" % (name,self.form_parms[name]) combobox.set_active(len(values)-idx) idx = -2 except KeyError: pass idx -= 1 combobox.set_active(idx) def callback(widget): model = widget.get_model() active = widget.get_active() if active < 0: active = 0 try: return (widget.get_data('name'), model[active][0]) except IndexError: pass | c2382404387dc87cc861620b92f02d5025c3db16 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5568/c2382404387dc87cc861620b92f02d5025c3db16/GTKUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1866,
67,
9663,
12,
2890,
16,
3384,
16,
529,
16,
2452,
16,
2372,
16,
636,
2116,
4672,
3894,
27570,
273,
22718,
18,
25053,
67,
2147,
67,
2704,
67,
955,
1435,
3894,
27570,
18,
542,
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,
1866,
67,
9663,
12,
2890,
16,
3384,
16,
529,
16,
2452,
16,
2372,
16,
636,
2116,
4672,
3894,
27570,
273,
22718,
18,
25053,
67,
2147,
67,
2704,
67,
955,
1435,
3894,
27570,
18,
542,
67,
... | |
def _cancel_build(self, build_url, exit_code=os.EX_OK): | def _cancel_build(self, build_url, exit_code=EX_OK): | def _cancel_build(self, build_url, exit_code=os.EX_OK): log.info('Cancelling build at %s', build_url) if not self.local: resp = self.request('DELETE', build_url) if resp.code not in (200, 204): log.error('Unexpected response (%d): %s', resp.code, resp.msg) raise ExitSlave(exit_code) | a584c9e123a18f69f98b82f7075d61e751a41675 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4547/a584c9e123a18f69f98b82f7075d61e751a41675/slave.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10996,
67,
3510,
12,
2890,
16,
1361,
67,
718,
16,
2427,
67,
710,
33,
2294,
67,
3141,
4672,
613,
18,
1376,
2668,
2568,
3855,
310,
1361,
622,
738,
87,
2187,
1361,
67,
718,
13,
309... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10996,
67,
3510,
12,
2890,
16,
1361,
67,
718,
16,
2427,
67,
710,
33,
2294,
67,
3141,
4672,
613,
18,
1376,
2668,
2568,
3855,
310,
1361,
622,
738,
87,
2187,
1361,
67,
718,
13,
309... |
out(' '*6+'\\textit{(type=%s)}\n\n' % | out(' '*6+'{\\it (type=%s)}\n\n' % | def write_func_list_box(self, out, var_doc): func_doc = var_doc.value is_inherited = (var_doc.overrides not in (None, UNKNOWN)) | 6fb49cf093665ae39b3a24201c873bf5dc8a8c4f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11420/6fb49cf093665ae39b3a24201c873bf5dc8a8c4f/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
644,
67,
1098,
67,
2147,
12,
2890,
16,
596,
16,
569,
67,
2434,
4672,
1326,
67,
2434,
273,
569,
67,
2434,
18,
1132,
353,
67,
6018,
329,
273,
261,
1401,
67,
2434,
18,
19775,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1045,
67,
644,
67,
1098,
67,
2147,
12,
2890,
16,
596,
16,
569,
67,
2434,
4672,
1326,
67,
2434,
273,
569,
67,
2434,
18,
1132,
353,
67,
6018,
329,
273,
261,
1401,
67,
2434,
18,
19775,
... |
os.renames(fullnukepath, nukemoveto) | shutil.move(fullnukepath, nukemoveto) | def find_relink(fullnukepath, nukemoveto): for x in os.listdir(download_dir): linkpath = os.path.join(download_dir, x) if os.path.islink(linkpath): if fullnukepath == os.readlink(linkpath): os.unlink(linkpath) os.symlink(nukemoveto, linkpath) break | e74602d00d0a0bc97cb32331f86d15c2f3ca6221 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13915/e74602d00d0a0bc97cb32331f86d15c2f3ca6221/tvwrangler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
266,
1232,
12,
2854,
29705,
803,
16,
9244,
79,
351,
1527,
11453,
4672,
364,
619,
316,
1140,
18,
1098,
1214,
12,
7813,
67,
1214,
4672,
1692,
803,
273,
1140,
18,
803,
18,
5701,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
67,
266,
1232,
12,
2854,
29705,
803,
16,
9244,
79,
351,
1527,
11453,
4672,
364,
619,
316,
1140,
18,
1098,
1214,
12,
7813,
67,
1214,
4672,
1692,
803,
273,
1140,
18,
803,
18,
5701,... |
totalmenusize+=os.path.getsize(os.path.join(getTempPath(),"menu-%s.mpg" % filecount)) / 1024 / 1024 | totalmenusize+=os.path.getsize(os.path.join(getTempPath(),"menu-%s.mpg" % filecount)) | def calculateFileSizes(files): """ Returns the sizes of all video, audio and menu files""" filecount=0 totalvideosize=0 totalaudiosize=0 totalmenusize=0 for node in files: filecount+=1 #Generate a temp folder name for this file folder=getItemTempPath(filecount) #Process this file file=os.path.join(folder,"stream.mv2") #Get size of video in MBytes totalvideosize+=os.path.getsize(file) / 1024 / 1024 #Get size of audio track 1 if doesFileExist(os.path.join(folder,"stream0.ac3")): totalaudiosize+=os.path.getsize(os.path.join(folder,"stream0.ac3")) / 1024 / 1024 if doesFileExist(os.path.join(folder,"stream0.mp2")): totalaudiosize+=os.path.getsize(os.path.join(folder,"stream0.mp2")) / 1024 / 1024 #Get size of audio track 2 if available if doesFileExist(os.path.join(folder,"stream1.ac3")): totalaudiosize+=os.path.getsize(os.path.join(folder,"stream1.ac3")) / 1024 / 1024 if doesFileExist(os.path.join(folder,"stream1.mp2")): totalaudiosize+=os.path.getsize(os.path.join(folder,"stream1.mp2")) / 1024 / 1024 # add chapter menu if available if doesFileExist(os.path.join(getTempPath(),"chaptermenu-%s.mpg" % filecount)): totalmenusize+=os.path.getsize(os.path.join(getTempPath(),"chaptermenu-%s.mpg" % filecount)) / 1024 / 1024 # add details page if available if doesFileExist(os.path.join(getTempPath(),"details-%s.mpg" % filecount)): totalmenusize+=os.path.getsize(os.path.join(getTempPath(),"details-%s.mpg" % filecount)) / 1024 / 1024 filecount=1 while doesFileExist(os.path.join(getTempPath(),"menu-%s.mpg" % filecount)): totalmenusize+=os.path.getsize(os.path.join(getTempPath(),"menu-%s.mpg" % filecount)) / 1024 / 1024 filecount+=1 return totalvideosize,totalaudiosize,totalmenusize | fe2a3bbe33f9454e9fa98bae37d53582fd2d4bb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13713/fe2a3bbe33f9454e9fa98bae37d53582fd2d4bb8/mythburn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
812,
11923,
12,
2354,
4672,
3536,
2860,
326,
8453,
434,
777,
6191,
16,
7447,
471,
3824,
1390,
8395,
585,
1883,
33,
20,
2078,
6768,
538,
554,
33,
20,
2078,
24901,
7441,
554,
33,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
812,
11923,
12,
2354,
4672,
3536,
2860,
326,
8453,
434,
777,
6191,
16,
7447,
471,
3824,
1390,
8395,
585,
1883,
33,
20,
2078,
6768,
538,
554,
33,
20,
2078,
24901,
7441,
554,
33,
2... |
fp = os.popen(cmd, "r") | dummy, fp = os.popen4(cmd, "r") dummy.close() | def _cmd(self, output, dir, *cmditems): """Internal routine to run a shell command in a given directory.""" cmd = ("cd \"%s\"; " % dir) + " ".join(cmditems) if output: output.write("+ %s\n" % cmd) if NO_EXECUTE: return 0 fp = os.popen(cmd, "r") while 1: line = fp.readline() if not line: break if output: output.write(line) rv = fp.close() return rv | d5999fa8a17185b8c7f68a75900fc4c6a3c11909 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d5999fa8a17185b8c7f68a75900fc4c6a3c11909/pimp.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4172,
12,
2890,
16,
876,
16,
1577,
16,
380,
4172,
3319,
4672,
3536,
3061,
12245,
358,
1086,
279,
5972,
1296,
316,
279,
864,
1867,
12123,
225,
1797,
273,
7566,
4315,
22049,
87,
2412,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4172,
12,
2890,
16,
876,
16,
1577,
16,
380,
4172,
3319,
4672,
3536,
3061,
12245,
358,
1086,
279,
5972,
1296,
316,
279,
864,
1867,
12123,
225,
1797,
273,
7566,
4315,
22049,
87,
2412,... |
debug('found SDK %s' % sdk.version) | debug('MSCommon/sdk.py:found SDK %s' % sdk.version) | def get_installed_sdks(): global InstalledSDKList global InstalledSDKMap if InstalledSDKList is None: InstalledSDKList = [] InstalledSDKMap = {} for sdk in SupportedSDKList: debug('trying to find SDK %s' % sdk.version) if sdk.get_sdk_dir(): debug('found SDK %s' % sdk.version) InstalledSDKList.append(sdk) InstalledSDKMap[sdk.version] = sdk return InstalledSDKList | c185949413a3b9d867b6dc34fb46e3bb731808c5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12817/c185949413a3b9d867b6dc34fb46e3bb731808c5/sdk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
13435,
67,
20907,
87,
13332,
2552,
13448,
4502,
22625,
682,
2552,
13448,
4502,
22625,
863,
309,
13448,
4502,
22625,
682,
353,
599,
30,
13448,
4502,
22625,
682,
273,
5378,
13448,
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,
336,
67,
13435,
67,
20907,
87,
13332,
2552,
13448,
4502,
22625,
682,
2552,
13448,
4502,
22625,
863,
309,
13448,
4502,
22625,
682,
353,
599,
30,
13448,
4502,
22625,
682,
273,
5378,
13448,
4... |
query.getStartIndex(), | start_index, | def __call__(self, query, result_type, logger): try: ResponseClass = self._result_map[result_type] except KeyError: raise ValueError('Unknown result type: %s' % str(result_type)) | 4243c0c6bf950d6c18447fb63b1d155e0493200a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12122/4243c0c6bf950d6c18447fb63b1d155e0493200a/dws.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
843,
16,
563,
67,
723,
16,
1194,
4672,
775,
30,
2306,
797,
273,
365,
6315,
2088,
67,
1458,
63,
2088,
67,
723,
65,
1335,
4999,
30,
1002,
2068,
2668,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
843,
16,
563,
67,
723,
16,
1194,
4672,
775,
30,
2306,
797,
273,
365,
6315,
2088,
67,
1458,
63,
2088,
67,
723,
65,
1335,
4999,
30,
1002,
2068,
2668,
487... |
self._contextMenu.Enable(wxID_UNDO, True) | self._contextMenu.Enable(wx.ID_UNDO, True) | def _UndoUpdateUI(self, event): if self._prevValue is None or self._prevValue == self._curValue: self._contextMenu.Enable(wxID_UNDO, False) else: self._contextMenu.Enable(wxID_UNDO, True) | ebc89b9f61e89f9da580f62e2d79179a3db38654 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/ebc89b9f61e89f9da580f62e2d79179a3db38654/maskededit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
31224,
1891,
5370,
12,
2890,
16,
871,
4672,
309,
365,
6315,
10001,
620,
353,
599,
578,
365,
6315,
10001,
620,
422,
365,
6315,
1397,
620,
30,
365,
6315,
2472,
4599,
18,
8317,
12,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
31224,
1891,
5370,
12,
2890,
16,
871,
4672,
309,
365,
6315,
10001,
620,
353,
599,
578,
365,
6315,
10001,
620,
422,
365,
6315,
1397,
620,
30,
365,
6315,
2472,
4599,
18,
8317,
12,
2... |
self.__getWidget("label_device_name").set_markup("<b>No device connected</b>") self.__getWidget("label_device_name2").set_markup("<b>No device connected</b>") prog_bar.set_fraction(0) prog_bar.set_text("") prog_bar.set_fraction(0) prog_bar.set_text("") self.__getWidget("label_information").set_text("No device connected") | self.__show_connected_state(False) def __show_connected_state(self, is_connected): self.__actiongroup_connected.set_sensitive(is_connected) self.__actiongroup.get_action("Connect").set_visible(not is_connected) self.__actiongroup.get_action("Disconnect").set_visible(is_connected) self.__getWidget("hbox_device_information").set_sensitive(is_connected) if is_connected: connected_device = self.__device_engine.get_device().get_name() else: connected_device = "No device connected" self.__getWidget("label_device_name").set_markup("<b>" + connected_device + "</b>") self.__getWidget("label_device_name2").set_markup("<b>" + connected_device + "</b>") if not is_connected: prog_bar = self.__getWidget("progressbar_disk_usage") prog_bar.set_fraction(0) prog_bar.set_text("") prog_bar = self.__getWidget("progressbar_batterie_level") prog_bar.set_fraction(0) prog_bar.set_text("") self.__getWidget("label_information").set_text("No device connected") else: used = self.__device_engine.get_device().get_diskusage()[0] total = self.__device_engine.get_device().get_diskusage()[1] prog_bar = self.__getWidget("progressbar_disk_usage") prog_bar.set_fraction(float(used)/float(total)) prog_bar.set_text("%s of %s" % (util.format_filesize(used), util.format_filesize(total))) max = self.__device_engine.get_device().get_batterylevel()[0] current = self.__device_engine.get_device().get_batterylevel()[1] prog_bar = self.__getWidget("progressbar_batterie_level") fraction = float(current)/float(max) prog_bar.set_fraction(fraction) prog_bar.set_text("%i%%" % (fraction * 100)) infos = self.__device_engine.get_device().get_information() text="" for info in infos: text += "<b>" + info[0] + ":</b> " + info[1] + "\n" self.__getWidget("label_information").set_markup(text) | def __disconnect_device(self): self.__device_engine.disconnect_device() self.__device_engine = None self.__treeview_track.set_model(None) self.__treeview_file.set_model(None) | d382ec2a930240988ff9b57599420845a0b6f246 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2271/d382ec2a930240988ff9b57599420845a0b6f246/MTPnavigator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
20177,
67,
5964,
12,
2890,
4672,
365,
16186,
5964,
67,
8944,
18,
20177,
67,
5964,
1435,
365,
16186,
5964,
67,
8944,
273,
599,
365,
16186,
3413,
1945,
67,
4101,
18,
542,
67,
2284,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
20177,
67,
5964,
12,
2890,
4672,
365,
16186,
5964,
67,
8944,
18,
20177,
67,
5964,
1435,
365,
16186,
5964,
67,
8944,
273,
599,
365,
16186,
3413,
1945,
67,
4101,
18,
542,
67,
2284,
... |
if self.specto.specto_gconf.get_entry("always_show_icon") == True: | if self.specto.specto_gconf.get_entry("always_show_icon") == True or self.indicator: | def close_event(self, *args): """ Return False to destroy the main window. """ if self.specto.specto_gconf.get_entry("always_show_icon") == True: self.notifier.hide() self.specto.specto_gconf.set_entry("show_notifier", False)#save the window state for the next time specto starts return True else: self.specto.quit() return True | ad6047613f47365c270a545a4da61d1268c69f00 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10818/ad6047613f47365c270a545a4da61d1268c69f00/notifier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
2575,
12,
2890,
16,
380,
1968,
4672,
3536,
2000,
1083,
358,
5546,
326,
2774,
2742,
18,
3536,
309,
365,
18,
13234,
83,
18,
13234,
83,
67,
75,
3923,
18,
588,
67,
4099,
2932,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
67,
2575,
12,
2890,
16,
380,
1968,
4672,
3536,
2000,
1083,
358,
5546,
326,
2774,
2742,
18,
3536,
309,
365,
18,
13234,
83,
18,
13234,
83,
67,
75,
3923,
18,
588,
67,
4099,
2932,
... |
def readmodule(module, path=[]): | def readmodule(module, path=None): | def readmodule(module, path=[]): '''Backwards compatible interface. Call readmodule_ex() and then only keep Class objects from the resulting dictionary.''' dict = _readmodule(module, path) res = {} for key, value in dict.items(): if isinstance(value, Class): res[key] = value return res | fe1372c7d504075eedd3913f8cf33709b8f153a5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/fe1372c7d504075eedd3913f8cf33709b8f153a5/pyclbr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
2978,
12,
2978,
16,
589,
33,
7036,
4672,
9163,
2711,
6397,
7318,
1560,
18,
225,
3049,
855,
2978,
67,
338,
1435,
471,
1508,
1338,
3455,
1659,
2184,
628,
326,
8156,
3880,
1093,
6309,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
2978,
12,
2978,
16,
589,
33,
7036,
4672,
9163,
2711,
6397,
7318,
1560,
18,
225,
3049,
855,
2978,
67,
338,
1435,
471,
1508,
1338,
3455,
1659,
2184,
628,
326,
8156,
3880,
1093,
6309,
... |
print "FAIL" | print "FAIL"; failures = failures + 1 | def __eq__(self, other): if isinstance(other, FooStruct): return self.bar == other.bar return 0 | 14105f5c7b7349c63655b5a3c3785fe12d84aa68 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11935/14105f5c7b7349c63655b5a3c3785fe12d84aa68/memcache.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
11253,
972,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
23077,
3823,
4672,
327,
365,
18,
3215,
422,
1308,
18,
3215,
327,
374,
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,
1001,
11253,
972,
12,
2890,
16,
1308,
4672,
309,
1549,
12,
3011,
16,
23077,
3823,
4672,
327,
365,
18,
3215,
422,
1308,
18,
3215,
327,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
user = _validate_and_get_geniuser(request) | try: user = _validate_and_get_geniuser(request) except LoggedInButFailedGetGeniUserError: return _show_failed_get_geniuser_page(request) | def mygeni(request): user = _validate_and_get_geniuser(request) total_vessel_credits = interface.get_total_vessel_credits(user) num_acquired_vessels = len(interface.get_acquired_vessels(user)) avail_vessel_credits = total_vessel_credits - num_acquired_vessels percent_total_used = int((num_acquired_vessels * 1.0 / total_vessel_credits * 1.0) * 100.0) # total_vessel_credits, percent_total_used, avail_vessel_credits return direct_to_template(request,'control/mygeni.html', {'username' : user.username, 'total_vessel_credits' : total_vessel_credits, 'percent_total_used' : percent_total_used, 'avail_vessel_credits' : avail_vessel_credits}) | f4fae4ee5e41faa500fcd1401c1644e384f32b77 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7263/f4fae4ee5e41faa500fcd1401c1644e384f32b77/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
4507,
77,
12,
2293,
4672,
775,
30,
729,
273,
389,
5662,
67,
464,
67,
588,
67,
4507,
77,
1355,
12,
2293,
13,
1335,
1827,
2423,
382,
31167,
2925,
967,
7642,
77,
1299,
668,
30,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3399,
4507,
77,
12,
2293,
4672,
775,
30,
729,
273,
389,
5662,
67,
464,
67,
588,
67,
4507,
77,
1355,
12,
2293,
13,
1335,
1827,
2423,
382,
31167,
2925,
967,
7642,
77,
1299,
668,
30,
32... |
text, nr = code_block_start.subn('<span class="code-block">', text, 1 ) if nr: text, nr = code_block_end.subn('</span>', text, 1 ) | match = re.match(code_block_start, text) if match: if match.group(1) and 'code' in match.group(1): text, nr = code_block_start.subn('<span class="code-block">', text, 1 ) if nr: text, nr = code_block_end.subn('</span>', text, 1 ) else: text = "</p>%s<p>" % text | def process(self, req, text, inline=False): if self.error: return system_message(util.Markup('Error: Failed to load processor ' '<code>%s</code>', self.name), self.error) text = self.processor(req, text) if inline: code_block_start = re.compile('^<div class="code-block">') code_block_end = re.compile('</div>$') text, nr = code_block_start.subn('<span class="code-block">', text, 1 ) if nr: text, nr = code_block_end.subn('</span>', text, 1 ) return text else: return text | 4e13f9661166b3460945d83f0d82de901d5d9105 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/4e13f9661166b3460945d83f0d82de901d5d9105/formatter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
12,
2890,
16,
1111,
16,
977,
16,
6370,
33,
8381,
4672,
309,
365,
18,
1636,
30,
327,
2619,
67,
2150,
12,
1367,
18,
13111,
2668,
668,
30,
11175,
358,
1262,
6659,
296,
2368,
710,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
1111,
16,
977,
16,
6370,
33,
8381,
4672,
309,
365,
18,
1636,
30,
327,
2619,
67,
2150,
12,
1367,
18,
13111,
2668,
668,
30,
11175,
358,
1262,
6659,
296,
2368,
710,
... |
self.groupBox_7.setGeometry(QtCore.QRect(10,340,711,62)) | sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,QtGui.QSizePolicy.Fixed) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.groupBox_7.sizePolicy().hasHeightForWidth()) self.groupBox_7.setSizePolicy(sizePolicy) self.groupBox_7.setMinimumSize(QtCore.QSize(0,62)) | def setupUi(self, MainWindow): MainWindow.setObjectName("MainWindow") MainWindow.resize(QtCore.QSize(QtCore.QRect(0,0,776,532).size()).expandedTo(MainWindow.minimumSizeHint())) MainWindow.setWindowIcon(QtGui.QIcon(" ")) | 63111e1c9754b5d54a0f7495871ccaf05c2651b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1108/63111e1c9754b5d54a0f7495871ccaf05c2651b1/main_ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
12740,
3829,
4672,
12740,
3829,
18,
542,
16707,
2932,
6376,
3829,
7923,
12740,
3829,
18,
15169,
12,
23310,
4670,
18,
53,
1225,
12,
23310,
4670,
18,
53,
6120,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
13943,
12,
2890,
16,
12740,
3829,
4672,
12740,
3829,
18,
542,
16707,
2932,
6376,
3829,
7923,
12740,
3829,
18,
15169,
12,
23310,
4670,
18,
53,
1225,
12,
23310,
4670,
18,
53,
6120,
1... |
if row[2].value == "M": | if cellvalue(row[2]) == "M": | def empty(cell): return cell.ctype == 0 | 600b9ed9ee66e29bc1f8bafb5b422a1f94c8d65c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12606/600b9ed9ee66e29bc1f8bafb5b422a1f94c8d65c/dbtks_avianbodymass.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1008,
12,
3855,
4672,
327,
2484,
18,
12387,
422,
374,
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,
1008,
12,
3855,
4672,
327,
2484,
18,
12387,
422,
374,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
int(testme) long(testme) float(testme) oct(testme) hex(testme) | if sys.platform[:4] != 'java': int(testme) long(testme) float(testme) oct(testme) hex(testme) else: print "__int__: ()" print "__long__: ()" print "__float__: ()" print "__oct__: ()" print "__hex__: ()" | exec """def __%(method)s__(self, *args): print "__%(method)s__:", args | a237ef12b412b9e8f7420da39a06d0a8ccb9c9ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/a237ef12b412b9e8f7420da39a06d0a8ccb9c9ef/test_class.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1196,
3536,
536,
1001,
17105,
2039,
13,
87,
972,
12,
2890,
16,
380,
1968,
4672,
1172,
10425,
17105,
2039,
13,
87,
972,
2773,
16,
833,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1196,
3536,
536,
1001,
17105,
2039,
13,
87,
972,
12,
2890,
16,
380,
1968,
4672,
1172,
10425,
17105,
2039,
13,
87,
972,
2773,
16,
833,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.failUnless(isinstance(sub2.typecode, sub.typecode.__class__), | self.failUnless(isinstance(sub2.typecode, sub1.typecode.__class__), | def test_local_type_substitution(self): self.types_module pyobj = GED('urn:test', 'test').pyclass() # derived type pyobj.Actor = sub = GTD('urn:test', 'IfElseActor')(None).pyclass() klass = 'myclass' name = 'whatever' | 217e56e70a75a35c110e489a17e27fc4358a676f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/14538/217e56e70a75a35c110e489a17e27fc4358a676f/test_DerivedTypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3729,
67,
723,
67,
1717,
14278,
12,
2890,
4672,
365,
18,
2352,
67,
2978,
2395,
2603,
273,
611,
2056,
2668,
321,
30,
3813,
2187,
296,
3813,
16063,
2074,
1106,
1435,
468,
10379,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3729,
67,
723,
67,
1717,
14278,
12,
2890,
4672,
365,
18,
2352,
67,
2978,
2395,
2603,
273,
611,
2056,
2668,
321,
30,
3813,
2187,
296,
3813,
16063,
2074,
1106,
1435,
468,
10379,
... |
if __debug__: print "cancel scheduled recolorizer" | if DEBUG: print "cancel scheduled recolorizer" | def toggle_colorize_event(self, event): if self.after_id: after_id = self.after_id self.after_id = None if __debug__: print "cancel scheduled recolorizer" self.after_cancel(after_id) if self.allow_colorizing and self.colorizing: if __debug__: print "stop colorizing" self.stop_colorizing = 1 self.allow_colorizing = not self.allow_colorizing if self.allow_colorizing and not self.colorizing: self.after_id = self.after(1, self.recolorize) if __debug__: print "auto colorizing turned", self.allow_colorizing and "on" or "off" return "break" | 4fe2a7039a545a4d36f56a714ca7de67724d5db9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/4fe2a7039a545a4d36f56a714ca7de67724d5db9/ColorDelegator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10486,
67,
3266,
554,
67,
2575,
12,
2890,
16,
871,
4672,
309,
365,
18,
5205,
67,
350,
30,
1839,
67,
350,
273,
365,
18,
5205,
67,
350,
365,
18,
5205,
67,
350,
273,
599,
309,
6369,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10486,
67,
3266,
554,
67,
2575,
12,
2890,
16,
871,
4672,
309,
365,
18,
5205,
67,
350,
30,
1839,
67,
350,
273,
365,
18,
5205,
67,
350,
365,
18,
5205,
67,
350,
273,
599,
309,
6369,
3... |
class HostAclIp(MMSQLObject): | class HostAclIp(SQLObject): class sqlmeta: cacheValues = False | def publiclist_hosts(productname=None, vername=None, archname=None): """ has a category of product, and an hcd that matches version """ product = None if productname is not None: try: product = Product.byName(productname) except SQLObjectNotFound: return [] if vername is not None and archname is not None: desiredPath = '(^|/)%s/.*%s/' % (vername, archname) elif vername is not None: desiredPath = '(^|/)%s/' % vername else: desiredPath = None sqlresult = _publiclist_hosts(Directory.select()[0], product=product, re=desiredPath) valid_categories = categorymap(productname, vername) return _publiclist_sql_to_list(sqlresult, valid_categories) | ec0d40658f0447775d65e70acc1cb8593a9f2027 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13031/ec0d40658f0447775d65e70acc1cb8593a9f2027/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1071,
1098,
67,
11588,
12,
5896,
529,
33,
7036,
16,
1924,
529,
33,
7036,
16,
6637,
529,
33,
7036,
4672,
3536,
711,
279,
3150,
434,
3017,
16,
471,
392,
366,
4315,
716,
1885,
1177,
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,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1071,
1098,
67,
11588,
12,
5896,
529,
33,
7036,
16,
1924,
529,
33,
7036,
16,
6637,
529,
33,
7036,
4672,
3536,
711,
279,
3150,
434,
3017,
16,
471,
392,
366,
4315,
716,
1885,
1177,
3536,... |
urllist = {} | urllist = [] | def download_file_node(item, path, force = False, handler = None, segmented=SEGMENTED, headers = {}): ''' Downloads a specific version of a program First parameter, file XML node Second parameter, file path to save to Third parameter, optional, force a new download even if a valid copy already exists Fouth parameter, optional, progress handler callback Returns list of file paths if download(s) is successful Returns False otherwise (checksum fails) raise socket.error e.g. "Operation timed out" ''' urllist = {} for node in item.resources: urllist[node.url] = node if len(urllist) == 0: print _("No urls to download file from.") return False hashes = item.hashlist size = item.size local_file = item.filename #localfile = path_join(path, local_file) item.filename = path_join(path, local_file) #extract chunk checksum information chunksize = item.piecelength chunksums = {} chunksums[item.piecetype] = item.pieces return download_file_urls(item, force, handler, segmented, headers) | 7c5559704a08cf33830fb1e794a2390e5d401eda /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6425/7c5559704a08cf33830fb1e794a2390e5d401eda/download.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
67,
768,
67,
2159,
12,
1726,
16,
589,
16,
2944,
273,
1083,
16,
1838,
273,
599,
16,
3267,
329,
33,
1090,
43,
16196,
6404,
16,
1607,
273,
2618,
4672,
9163,
13059,
87,
279,
2923,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4224,
67,
768,
67,
2159,
12,
1726,
16,
589,
16,
2944,
273,
1083,
16,
1838,
273,
599,
16,
3267,
329,
33,
1090,
43,
16196,
6404,
16,
1607,
273,
2618,
4672,
9163,
13059,
87,
279,
2923,
... |
Let `M=` ``self.lattice().dual()`` be the lattice dual to the | Let `M=` ``self.dual_lattice()`` be the lattice dual to the | def orthogonal_sublattice(self, *args, **kwds): r""" The sublattice (in the dual lattice) orthogonal to the sublattice spanned by the cone. | a3e3306597435e3589001abd0b89714b99258af9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a3e3306597435e3589001abd0b89714b99258af9/cone.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16208,
28396,
67,
87,
440,
24966,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
1021,
17809,
24966,
261,
267,
326,
24557,
16690,
13,
16208,
28396,
358,
326,
17809,
24966,
1694... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16208,
28396,
67,
87,
440,
24966,
12,
2890,
16,
380,
1968,
16,
2826,
25577,
4672,
436,
8395,
1021,
17809,
24966,
261,
267,
326,
24557,
16690,
13,
16208,
28396,
358,
326,
17809,
24966,
1694... |
if num_real_where_clauses == 0: where = where.replace('WHERE GROUP BY', 'GROUP BY') else: where = where.replace('AND GROUP BY', 'GROUP BY') | group_by_clause = 'GROUP BY ' + ', '.join(group_fields) group_by_position = where.rfind('ORDER BY') if group_by_position == -1: group_by_position = len(where) where = (where[:group_by_position] + group_by_clause + ' ' + where[group_by_position:]) | def _get_group_query_sql(self, query, group_by, extra_select_fields): group_fields = self._get_field_names(group_by) if query._distinct: pk_field = self._get_key_on_this_table(self.model._meta.pk.name) count_sql = 'COUNT(DISTINCT %s)' % pk_field else: count_sql = 'COUNT(1)' select_fields = (group_fields + [count_sql + ' AS ' + self._GROUP_COUNT_NAME] + extra_select_fields) | 225918b389ecc937d1a32650fc47579d799d957c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12268/225918b389ecc937d1a32650fc47579d799d957c/models.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
1655,
67,
2271,
67,
4669,
12,
2890,
16,
843,
16,
1041,
67,
1637,
16,
2870,
67,
4025,
67,
2821,
4672,
1041,
67,
2821,
273,
365,
6315,
588,
67,
1518,
67,
1973,
12,
1655,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1655,
67,
2271,
67,
4669,
12,
2890,
16,
843,
16,
1041,
67,
1637,
16,
2870,
67,
4025,
67,
2821,
4672,
1041,
67,
2821,
273,
365,
6315,
588,
67,
1518,
67,
1973,
12,
1655,
... |
sage: a(0) 0 sage: a(1) 1 sage: a(2) 1 sage: a(12) 0 sage: a.list(13) [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0] AUTHOR: -- Jaap Spies (2007-02-02) """ def __init__(self): | Let $A_k$ denote the first $2^k$ terms; then $A_0 = 0$, and for $k \ge 0$, $A_{k+1} = A_k B_k$, where $B_k$ is obtained from $A_k$ by interchanging 0's and 1's. INPUT: n -- non negative integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A010060;a Thue-Morse sequence. sage: a(0) 0 sage: a(1) 1 sage: a(2) 1 sage: a(12) 0 sage: a.list(13) [0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0] AUTHOR: -- Jaap Spies (2007-02-02) """ | def _eval(self, n): return self.f(n) | 69a199217d612e1c590af73e16003812c85b93ec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/69a199217d612e1c590af73e16003812c85b93ec/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
327,
365,
18,
74,
12,
82,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
389,
8622,
12,
2890,
16,
290,
4672,
327,
365,
18,
74,
12,
82,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self.manage_addProduct["EasyNewsletter"].addENLSubscriber(id=subscriber_id) | execute_under_special_role(portal, "Contributor", self.invokeFactory, "ENLSubscriber", id=subscriber_id) | def addSubscriber(self, subscriber, fullname, organization): """Adds a new subscriber to the newsletter (if valid). """ # we need the subscriber email here as an id, to check for existing entries email = subscriber plone_utils = getToolByName(self, 'plone_utils') subscriber_id = plone_utils.normalizeString(email) try: self.manage_addProduct["EasyNewsletter"].addENLSubscriber(id=subscriber_id) except BadRequest: return (False, "email_exists") o = getattr(self, subscriber_id) o.setEmail(subscriber) o.setFullname(fullname) o.setOrganization(organization) return (True, "subscription_confirmed") | d6077dfcd1d8096fd85ff3c282992248384d909d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5110/d6077dfcd1d8096fd85ff3c282992248384d909d/EasyNewsletter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
11118,
12,
2890,
16,
9467,
16,
13321,
16,
6758,
4672,
3536,
3655,
279,
394,
9467,
358,
326,
14783,
13449,
261,
430,
923,
2934,
3536,
468,
732,
1608,
326,
9467,
2699,
2674,
487,
392,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
11118,
12,
2890,
16,
9467,
16,
13321,
16,
6758,
4672,
3536,
3655,
279,
394,
9467,
358,
326,
14783,
13449,
261,
430,
923,
2934,
3536,
468,
732,
1608,
326,
9467,
2699,
2674,
487,
392,... |
return _sparsetools.csrtocsc(*args) | return _sparsetools.csrtocsc(*args) | def csrtocsc(*args): """ csrtocsc(int n_row, int n_col, int Ap, int Aj, float Ax, std::vector<(int)> Bp, std::vector<(int)> Bi, std::vector<(float)> Bx) csrtocsc(int n_row, int n_col, int Ap, int Aj, double Ax, std::vector<(int)> Bp, std::vector<(int)> Bi, std::vector<(double)> Bx) csrtocsc(int n_row, int n_col, int Ap, int Aj, long double Ax, std::vector<(int)> Bp, std::vector<(int)> Bi, std::vector<(long double)> Bx) csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_cfloat Ax, std::vector<(int)> Bp, std::vector<(int)> Bi, std::vector<(npy_cfloat)> Bx) csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_cdouble Ax, std::vector<(int)> Bp, std::vector<(int)> Bi, std::vector<(npy_cdouble)> Bx) csrtocsc(int n_row, int n_col, int Ap, int Aj, npy_clongdouble Ax, std::vector<(int)> Bp, std::vector<(int)> Bi, std::vector<(npy_clongdouble)> Bx) """ return _sparsetools.csrtocsc(*args) | 5ae78c789fc0e199f798df7b612701ba4deb366c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12971/5ae78c789fc0e199f798df7b612701ba4deb366c/sparsetools.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13271,
1391,
1017,
30857,
1968,
4672,
3536,
13271,
1391,
1017,
12,
474,
290,
67,
492,
16,
509,
290,
67,
1293,
16,
509,
1716,
16,
509,
432,
78,
16,
1431,
22516,
16,
2044,
2866,
7737,
32... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13271,
1391,
1017,
30857,
1968,
4672,
3536,
13271,
1391,
1017,
12,
474,
290,
67,
492,
16,
509,
290,
67,
1293,
16,
509,
1716,
16,
509,
432,
78,
16,
1431,
22516,
16,
2044,
2866,
7737,
32... |
"""LabelEntry - Entry field with label. | """LabelEntry - Entry field with label. Packages an entry widget and a label into one mega widget. It can beused be used to simplify the creation of ``entry-form'' type of interface. | def __init__ (self,master=None,cnf={}, **kw): TixWidget.__init__(self, master, 'tixInputOnly', None, cnf, kw) | 48af83dadc128720a7642beb50800c6971404eb9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/48af83dadc128720a7642beb50800c6971404eb9/Tix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
7525,
33,
7036,
16,
10305,
74,
28793,
2826,
9987,
4672,
399,
697,
4609,
16186,
2738,
972,
12,
2890,
16,
4171,
16,
296,
88,
697,
1210,
3386,
2187,
599,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
261,
2890,
16,
7525,
33,
7036,
16,
10305,
74,
28793,
2826,
9987,
4672,
399,
697,
4609,
16186,
2738,
972,
12,
2890,
16,
4171,
16,
296,
88,
697,
1210,
3386,
2187,
599,
1... |
if (len(matched) < 5 or len(matched) > 7: | if len(matched) < 5 or len(matched) > 7: | def build_callee(self, line): | b409948d95ef1617325b18b24a6ae908f2534ca0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9791/b409948d95ef1617325b18b24a6ae908f2534ca0/pyprofgen.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
771,
11182,
12,
2890,
16,
980,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
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,
1361,
67,
771,
11182,
12,
2890,
16,
980,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
parent = self.aq_parent try: ob = parent[REQUEST['target']] except AttributeError: | parent = self.aq_parent try: ob = parent[REQUEST['target']] except AttributeError: | def index_html(self, REQUEST, RESPONSE): """Publish the object to the external editor helper app""" security = getSecurityManager() | 5b56cd9a97a50f9b8ed42de487c5c5c97f2b5ea4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/5b56cd9a97a50f9b8ed42de487c5c5c97f2b5ea4/ExternalEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
770,
67,
2620,
12,
2890,
16,
12492,
16,
20645,
4672,
3536,
6024,
326,
733,
358,
326,
3903,
4858,
4222,
595,
8395,
225,
4373,
273,
19288,
1318,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
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,
770,
67,
2620,
12,
2890,
16,
12492,
16,
20645,
4672,
3536,
6024,
326,
733,
358,
326,
3903,
4858,
4222,
595,
8395,
225,
4373,
273,
19288,
1318,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100... |
self.refreshCompCtrl() | def inspectorPost(self, closeEditor = true): if self.editorCtrl: v = self.getValue() cv = self.getCtrlValue() if v != cv: self.validateProp(v, cv) self.setCtrlValue(cv, v) self.persistValue(self.valueAsExpr()) else: pass if closeEditor: self.editorCtrl.destroyControl() self.editorCtrl = None self.refreshCompCtrl() | 43e4ab46eed5e41d2af40091522912ba9175fcc3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/43e4ab46eed5e41d2af40091522912ba9175fcc3/PropertyEditors.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
22700,
3349,
12,
2890,
16,
1746,
6946,
273,
638,
4672,
309,
365,
18,
9177,
12418,
30,
331,
273,
365,
18,
24805,
1435,
8951,
273,
365,
18,
588,
12418,
620,
1435,
309,
331,
480,
8951,
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,
22700,
3349,
12,
2890,
16,
1746,
6946,
273,
638,
4672,
309,
365,
18,
9177,
12418,
30,
331,
273,
365,
18,
24805,
1435,
8951,
273,
365,
18,
588,
12418,
620,
1435,
309,
331,
480,
8951,
30... | |
if len(self.stream_list) != len(self.results): | if (len(self.stream_list) != len(self.results) and 2*len(self.stream_list) != len(self.results)): | def postprocess(self): if self.role == 'client': if len(self.stream_list) != len(self.results): raise error.TestError('Mismatched number of results') | 6993d7951b92c075ed4b9898f681fed8ed695618 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10349/6993d7951b92c075ed4b9898f681fed8ed695618/netperf2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1603,
2567,
12,
2890,
4672,
309,
365,
18,
4615,
422,
296,
2625,
4278,
225,
309,
261,
1897,
12,
2890,
18,
3256,
67,
1098,
13,
480,
562,
12,
2890,
18,
4717,
13,
471,
576,
14,
1897,
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,
1603,
2567,
12,
2890,
4672,
309,
365,
18,
4615,
422,
296,
2625,
4278,
225,
309,
261,
1897,
12,
2890,
18,
3256,
67,
1098,
13,
480,
562,
12,
2890,
18,
4717,
13,
471,
576,
14,
1897,
12,... |
outP = self.__E2(outP) return outP | output_base_ring = self.__E2.base_ring() outE2 = self.__E2 R = output_base_ring return outE2.point([R(outP[0]), R(outP[1]), R(1)], check=False) | def __call__(self, P, output_base_ring=None): r""" Function that implements the call-ability of elliptic curve isogenies. | d8b812384321cf00512524bf05863ee5a747c2fc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/d8b812384321cf00512524bf05863ee5a747c2fc/ell_curve_isogeny.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
453,
16,
876,
67,
1969,
67,
8022,
33,
7036,
4672,
436,
8395,
4284,
716,
4792,
326,
745,
17,
2967,
434,
415,
549,
21507,
8882,
353,
19409,
606,
18,
2,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
453,
16,
876,
67,
1969,
67,
8022,
33,
7036,
4672,
436,
8395,
4284,
716,
4792,
326,
745,
17,
2967,
434,
415,
549,
21507,
8882,
353,
19409,
606,
18,
2,
-... |
self.handlePoint1, self.handlePoint2 = handlePoint1, handlePoint2 | self.handlePoint1, self.handlePoint2 = handlePoint1, handlePoint2 | def updateHandlePositions(self): """ Update handle positions and also update the resize handle radii and their 'stopper' lengths. @see: self._update_resizeHandle_radius() @see: self._update_resizeHandle_stopper_length() @see: DnaSegment_GraphicsMode._drawHandles() """ if len(self.handles) == 0: #No handles are appended to self.handles list. #@See self.model_changed() and self._updateHandleList() return #TODO: Call this method less often by implementing model_changed #see bug 2729 for a planned optimization self.cylinderWidth = CYLINDER_WIDTH_DEFAULT_VALUE self.cylinderWidth2 = CYLINDER_WIDTH_DEFAULT_VALUE self._update_resizeHandle_radius() handlePoint1, handlePoint2 = self.struct.getAxisEndPoints() | 90d44b80bee2c8bc79011f1c677cd0e594345683 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/90d44b80bee2c8bc79011f1c677cd0e594345683/DnaSegment_EditCommand.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
3259,
11024,
12,
2890,
4672,
3536,
2315,
1640,
6865,
471,
2546,
1089,
326,
7041,
1640,
28125,
471,
3675,
296,
5681,
457,
11,
10917,
18,
632,
5946,
30,
365,
6315,
2725,
67,
15169,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
3259,
11024,
12,
2890,
4672,
3536,
2315,
1640,
6865,
471,
2546,
1089,
326,
7041,
1640,
28125,
471,
3675,
296,
5681,
457,
11,
10917,
18,
632,
5946,
30,
365,
6315,
2725,
67,
15169,
3... |
def __init__(self, master=None): | def __init__(self, master=None, value=None, name=None): | def __init__(self, master=None): """Construct a float variable. | 72daca43c49dee94d35b25084bba9045bd6d0f49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/72daca43c49dee94d35b25084bba9045bd6d0f49/Tkinter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
33,
7036,
16,
460,
33,
7036,
16,
508,
33,
7036,
4672,
3536,
7249,
279,
1431,
2190,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
4171,
33,
7036,
16,
460,
33,
7036,
16,
508,
33,
7036,
4672,
3536,
7249,
279,
1431,
2190,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
rtm_task = self.rtm_proxy.create_new_rtm_task(task.get_title()) self._populate_rtm_task(task, rtm_task) | if task.get_status() != Task.STA_ACTIVE: return try: rtm_task = self.rtm_proxy.create_new_rtm_task(task.get_title()) self._populate_rtm_task(task, rtm_task) except: rtm_task.delete() raise | def set_task(self, task): """ See GenericBackend for an explanation of this function. """ if not self.rtm_proxy.is_authenticated(): return self.cancellation_point() tid = task.get_id() is_syncable = self._gtg_task_is_syncable_per_attached_tags(task) action, rtm_task_id = self.sync_engine.analyze_local_id( \ tid, \ self.datastore.has_task, \ self.rtm_proxy.has_rtm_task, \ is_syncable) Log.debug("GTG->RTM set task (%s, %s)" % (action, is_syncable)) | fffe3b9f55f5154c782ebf92f94d5c77ce8b695b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8234/fffe3b9f55f5154c782ebf92f94d5c77ce8b695b/backend_rtm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4146,
12,
2890,
16,
1562,
4672,
3536,
2164,
7928,
7172,
364,
392,
21285,
434,
333,
445,
18,
3536,
309,
486,
365,
18,
3797,
81,
67,
5656,
18,
291,
67,
14454,
13332,
327,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
4146,
12,
2890,
16,
1562,
4672,
3536,
2164,
7928,
7172,
364,
392,
21285,
434,
333,
445,
18,
3536,
309,
486,
365,
18,
3797,
81,
67,
5656,
18,
291,
67,
14454,
13332,
327,
365,
... |
mimetype = self.getMimeType(link) | if ((link[-4:].lower() in ['.mov','.wmv','.mp4','.mp3','.mpg','.avi']) or (link[-5:].lower() in ['.mpeg'])): mimetype = 'video/unknown' elif link.find('?') > 0 and link.lower().find('.htm') == -1: mimetype = self.getMimeType(link) else: mimetype = 'text/html' | def processLinks(self,links, depth = 0,linkNumber = 0): maxDepth = 2 urls = links[0] links = links[1] if depth<maxDepth: for link in urls: if depth == 0: linkNumber += 1 print "Processing %s (%d)" % (link,linkNumber) #FIXME keep the connection open mimetype = self.getMimeType(link) #print " mimetype is "+mimetype if mimetype != None: #This is text of some sort: HTML, XML, etc. if (mimetype.startswith('text/html') or mimetype.startswith('application/xhtml+xml') or mimetype.startswith('text/xml') or mimetype.startswith('application/xml') or mimetype.startswith('application/rss+xml') or mimetype.startswith('application/atom+xml') or mimetype.startswith('application/rdf+xml') ): (html, url, redirURL,status,charset) = self.getHTML(link) if status == 304: #It's cached pass elif not html is None: subLinks = self.scrapeLinks(html, redirURL,charset=charset) if depth == 0: self.semaphore.acquire() #print "Acquiring semaphore" thread = Thread(target = self.makeProcessLinkFunc(subLinks,depth+1,linkNumber)) thread.setDaemon(False) thread.start() else: self.processLinks(subLinks,depth+1,linkNumber) else: pass #print link+" seems to be bogus..." #This is a video elif (mimetype.startswith('video/') or mimetype.startswith('audeo/') or mimetype == "application/x-bittorrent"): self.addVideoItem(link, links[link],linkNumber) | ccb1ac034b7f82523c86b1f66e40bcc0de4b0001 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12354/ccb1ac034b7f82523c86b1f66e40bcc0de4b0001/feed.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
7100,
12,
2890,
16,
7135,
16,
3598,
273,
374,
16,
1232,
1854,
273,
374,
4672,
22074,
273,
576,
6903,
273,
4716,
63,
20,
65,
4716,
273,
4716,
63,
21,
65,
309,
3598,
32,
1896,
61... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7100,
12,
2890,
16,
7135,
16,
3598,
273,
374,
16,
1232,
1854,
273,
374,
4672,
22074,
273,
576,
6903,
273,
4716,
63,
20,
65,
4716,
273,
4716,
63,
21,
65,
309,
3598,
32,
1896,
61... |
'<col />\n' | def visit_citation(self, node): self.body.append(self.starttag(node, 'table', CLASS='citation', frame="void", rules="none")) self.body.append('<colgroup><col class="label" /><col /></colgroup>\n' '<col />\n' '<tbody valign="top">\n' '<tr>') self.footnote_backrefs(node) | 19665612cb57f832b6b00df2df10a8908e7866cb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/19665612cb57f832b6b00df2df10a8908e7866cb/html4css1.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
67,
71,
8773,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
2121,
2187,
7383,
2218,
71,
8773,
2187,
2623,
1546,
6459,
3113,
2931,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
71,
8773,
12,
2890,
16,
756,
4672,
365,
18,
3432,
18,
6923,
12,
2890,
18,
1937,
2692,
12,
2159,
16,
296,
2121,
2187,
7383,
2218,
71,
8773,
2187,
2623,
1546,
6459,
3113,
2931,... | |
value = self._poly_ring(value) | value = self._poly_ring._coerce_(value) | def __call__(self, value): # todo: I don't understand why the direct _poly_ring.__call__() # doesn't work.... # try coercing to base ring try: value = self._base_ring(value) value = self._poly_ring(value) except TypeError: # try coercing to underlying polynomial ring value = self._poly_ring(value) | 4944826ae27045c2744ba73d17527439933cdb23 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9890/4944826ae27045c2744ba73d17527439933cdb23/monsky_washnitzer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
460,
4672,
468,
10621,
30,
467,
2727,
1404,
22413,
11598,
326,
2657,
389,
16353,
67,
8022,
16186,
1991,
972,
1435,
468,
3302,
1404,
1440,
6265,
225,
468,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
460,
4672,
468,
10621,
30,
467,
2727,
1404,
22413,
11598,
326,
2657,
389,
16353,
67,
8022,
16186,
1991,
972,
1435,
468,
3302,
1404,
1440,
6265,
225,
468,
7... |
def remove_user(self, username, pkg_name, collectn_list=None) | def remove_user(self, username, pkg_name, collectn_list=None): | def remove_user(self, username, pkg_name, collectn_list=None) '''Remove user from a package :arg username: Name of user to remove from the package :arg pkg_name: Name of the package :arg collectn_list: list of collections like 'F-10','devel'. If collectn_list=None, user removed from all collections associates with the package. ''' | 2cbe31af31e185976a6055e79761963f9bff7d1c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9952/2cbe31af31e185976a6055e79761963f9bff7d1c/pkgdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
67,
1355,
12,
2890,
16,
2718,
16,
3475,
67,
529,
16,
3274,
82,
67,
1098,
33,
7036,
4672,
9163,
3288,
729,
628,
279,
2181,
225,
294,
3175,
2718,
30,
1770,
434,
729,
358,
1206,
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,
1206,
67,
1355,
12,
2890,
16,
2718,
16,
3475,
67,
529,
16,
3274,
82,
67,
1098,
33,
7036,
4672,
9163,
3288,
729,
628,
279,
2181,
225,
294,
3175,
2718,
30,
1770,
434,
729,
358,
1206,
6... |
length = libvlc.libvlc_media_player_get_length(media_player, byref(exception)) | length = libvlc.libvlc_media_player_get_length(media_player, byref(exception)) | def make_snapshot(video_path, thumbnail_path): if os.path.exists(thumbnail_path): os.remove(thumbnail_path) mrl = 'file://%s' % video_path vlc = init_vlc( "vlc", "--noaudio", '--vout', 'dummy', '--no-video-title-show', '--quiet', '--nostats', '--intf', 'dummy', '--plugin-path', 'vlc-plugins') media_player = libvlc.libvlc_media_player_new(vlc, byref(exception)) check_exception() media = libvlc.libvlc_media_new(vlc, ctypes.c_char_p(mrl), byref(exception)) check_exception() libvlc.libvlc_media_player_set_media(media_player, media, byref(exception)) check_exception() libvlc.libvlc_media_player_play(media_player, byref(exception)) check_exception() wait_for_play(media_player) length = libvlc.libvlc_media_player_get_length(media_player, byref(exception)) check_exception() libvlc.libvlc_media_player_set_position(media_player, ctypes.c_float(0.5), byref(exception)) check_exception() sleep(0.5) # allow a little time for VLC to seek libvlc.libvlc_video_take_snapshot(media_player, ctypes.c_char_p(thumbnail_path), ctypes.c_int(0), ctypes.c_int(0), byref(exception)) check_exception() sleep(0.5) # allow a little time for VLC to take the snapshot libvlc.libvlc_media_player_stop(media_player, byref(exception)) check_exception() libvlc.libvlc_media_player_set_media(None, byref(exception)) check_exception() libvlc.libvlc_media_release(media) libvlc.libvlc_media_player_release(media_player) libvlc.libvlc_release(vlc) print "Miro-Movie-Data-Length: %d" % (length) if os.path.exists(thumbnail_path): print "Miro-Movie-Data-Thumbnail: Success" else: print "Miro-Movie-Data-Thumbnail: Failure" | 9f7bf5af1ebabd9aac5b02bee939b965cd88bd61 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/9f7bf5af1ebabd9aac5b02bee939b965cd88bd61/moviedata_util.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
11171,
12,
9115,
67,
803,
16,
9134,
67,
803,
4672,
309,
1140,
18,
803,
18,
1808,
12,
14904,
67,
803,
4672,
1140,
18,
4479,
12,
14904,
67,
803,
13,
312,
1321,
273,
296,
768,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
11171,
12,
9115,
67,
803,
16,
9134,
67,
803,
4672,
309,
1140,
18,
803,
18,
1808,
12,
14904,
67,
803,
4672,
1140,
18,
4479,
12,
14904,
67,
803,
13,
312,
1321,
273,
296,
768,... |
self.glv_add_struct(struct) | glstruct = self.glv_add_struct(struct) for glchain in glstruct.glo_iter_children(): glchain.properties.update( ball_stick = True, ellipse = True) | def load_struct(self, path): """Loads the requested structure. """ info("loading: %s" % (path)) try: struct = LoadStructure( fil = path, build_properties = ("library_bonds","distance_bonds")) except IOError: error("file not found: %s" % (path)) return | 878842438ad5dcf87f49337f7c582fe163496f4b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10674/878842438ad5dcf87f49337f7c582fe163496f4b/glutviewer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1262,
67,
1697,
12,
2890,
16,
589,
4672,
3536,
7968,
326,
3764,
3695,
18,
3536,
1123,
2932,
15174,
30,
738,
87,
6,
738,
261,
803,
3719,
225,
775,
30,
1958,
273,
4444,
6999,
12,
661,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1697,
12,
2890,
16,
589,
4672,
3536,
7968,
326,
3764,
3695,
18,
3536,
1123,
2932,
15174,
30,
738,
87,
6,
738,
261,
803,
3719,
225,
775,
30,
1958,
273,
4444,
6999,
12,
661,
... |
try: del dispatcher.async_writable[fd] | pass else: try: del dispatcher.async_readable[fd] | def del_channel (dispatcher): fd = dispatcher._fileno dispatcher._fileno = None del dispatcher.async_map[fd] try: del dispatcher.async_readable[fd] except KeyError: try: del dispatcher.async_writable[fd] except KeyError: del dispatcher.async_stalled[fd] | a441702b924316d199fdc04b963957ba4af6954a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2577/a441702b924316d199fdc04b963957ba4af6954a/async_c10k.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1464,
67,
4327,
261,
18495,
4672,
5194,
273,
7393,
6315,
7540,
5764,
7393,
6315,
7540,
5764,
273,
599,
1464,
7393,
18,
3810,
67,
1458,
63,
8313,
65,
775,
30,
1464,
7393,
18,
3810,
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,
1464,
67,
4327,
261,
18495,
4672,
5194,
273,
7393,
6315,
7540,
5764,
7393,
6315,
7540,
5764,
273,
599,
1464,
7393,
18,
3810,
67,
1458,
63,
8313,
65,
775,
30,
1464,
7393,
18,
3810,
67,
... |
def acquire(blocking): | def acquire(self, blocking): | def acquire(blocking): """ <Purpose> Acquires the lock. | d34b3dd830578d7733d94d0eb292bb0d6d6bf584 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7263/d34b3dd830578d7733d94d0eb292bb0d6d6bf584/emulmisc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10533,
12,
2890,
16,
9445,
4672,
3536,
411,
10262,
4150,
34,
12848,
4138,
326,
2176,
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,
10533,
12,
2890,
16,
9445,
4672,
3536,
411,
10262,
4150,
34,
12848,
4138,
326,
2176,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
- Wigner $6j$ symbols are left invariant under any permutation of | - Wigner 6j symbols are left invariant under any permutation of | def wigner_6j(j_1, j_2, j_3, j_4, j_5, j_6, prec=None): r""" Calculate the Wigner 6j symbol `Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6)`. INPUT: - ``j_1``, ..., ``j_6`` - 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_6j(3,3,3,3,3,3) -1/14 sage: wigner_6j(5,5,5,5,5,5) 1/52 sage: wigner_6j(6,6,6,6,6,6) 309/10868 sage: wigner_6j(8,8,8,8,8,8) -12219/965770 sage: wigner_6j(30,30,30,30,30,30) 36082186869033479581/87954851694828981714124 sage: wigner_6j(0.5,0.5,1,0.5,0.5,1) 1/6 sage: wigner_6j(200,200,200,200,200,200, prec=1000)*1.0 0.000155903212413242 It is an error to have arguments that are not integer or half integer values or do not fulfil the triangle relation:: sage: wigner_6j(2.5,2.5,2.5,2.5,2.5,2.5) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation sage: wigner_6j(0.5,0.5,1.1,0.5,0.5,1.1) Traceback (most recent call last): ... ValueError: j values must be integer or half integer and fulfil the triangle relation NOTES: The Wigner 6j symbol is related to the Racah symbol but exhibits more symmetries as detailed below. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =(-1)^{j_1+j_2+j_4+j_5} W(j_1,j_2,j_5,j_4,j_3,j_6) The Wigner 6j symbol obeys the following symmetry rules: - Wigner $6j$ symbols are left invariant under any permutation of the columns: .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_3,j_1,j_2,j_6,j_4,j_5) =Wigner6j(j_2,j_3,j_1,j_5,j_6,j_4) =Wigner6j(j_3,j_2,j_1,j_6,j_5,j_4) =Wigner6j(j_1,j_3,j_2,j_4,j_6,j_5) =Wigner6j(j_2,j_1,j_3,j_5,j_4,j_6) - They are invariant under the exchange of the upper and lower arguments in each of any two columns, i. e. .. math:: Wigner6j(j_1,j_2,j_3,j_4,j_5,j_6) =Wigner6j(j_1,j_5,j_6,j_4,j_2,j_3) =Wigner6j(j_4,j_2,j_6,j_1,j_5,j_3) =Wigner6j(j_4,j_5,j_3,j_1,j_2,j_6) - additional 6 symmetries [Regge59] giving rise to 144 symmetries in total - only non-zero if any triple of `j`'s fulfil a triangle relation ALGORITHM: This function uses the algorithm of [Edmonds74] to calculate the value of the 6j 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: - [Regge59] 'Symmetry Properties of Racah Coefficients', T. Regge, Nuovo Cimento, Volume 11, pp. 116 (1959) - [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) """ res = (-1) ** (int(j_1 + j_2 + j_4 + j_5)) * \ racah(j_1, j_2, j_5, j_4, j_3, j_6, prec) return res | 2aae1a34350173041dcaa920c230128b23fb8288 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/2aae1a34350173041dcaa920c230128b23fb8288/wigner.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
341,
724,
264,
67,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
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,
26,
78,
12,
78,
67,
21,
16,
525,
67,
22,
16,
525,
67,
23,
16,
525,
67,
24,
16,
525,
67,
25,
16,
525,
67,
26,
16,
13382,
33,
7036,
4672,
436,
8395,
9029,
326,... |
""" | r""" | def eulers_method_2x2(f,g, t0, x0, y0, h, t1,method="table"): """ This implements Euler's method for finding numerically the solution of the 1st order system of two ODEs ``x' = f(t, x, y), x(t0)=x0.`` ``y' = g(t, x, y), y(t0)=y0.`` The "t" column of the table increments from `t_0` to `t_1` by `h` (so `\\frac{t_1-t_0}{h}` must be an integer). In the "x" column, the new x-value equals the old x-value plus the corresponding entry in the next (third) column. In the "y" column, the new y-value equals the old y-value plus the corresponding entry in the next (last) column. *For pedagogical purposes only.* EXAMPLES:: sage: from sage.calculus.desolvers import eulers_method_2x2 sage: t, x, y = PolynomialRing(QQ,3,"txy").gens() sage: f = x+y+t; g = x-y sage: eulers_method_2x2(f,g, 0, 0, 0, 1/3, 1,method="none") [[0, 0, 0], [1/3, 0, 0], [2/3, 1/9, 0], [1, 10/27, 1/27], [4/3, 68/81, 4/27]] :: sage: eulers_method_2x2(f,g, 0, 0, 0, 1/3, 1) t x h*f(t,x,y) y h*g(t,x,y) 0 0 0 0 0 1/3 0 1/9 0 0 2/3 1/9 7/27 0 1/27 1 10/27 38/81 1/27 1/9 :: sage: RR = RealField(sci_not=0, prec=4, rnd='RNDU') sage: t,x,y=PolynomialRing(RR,3,"txy").gens() sage: f = x+y+t; g = x-y sage: eulers_method_2x2(f,g, 0, 0, 0, 1/3, 1) t x h*f(t,x,y) y h*g(t,x,y) 0 0 0.00 0 0.00 1/3 0.00 0.13 0.00 0.00 2/3 0.13 0.29 0.00 0.043 1 0.41 0.57 0.043 0.15 To numerically approximate `y(1)`, where `(1+t^2)y''+y'-y=0`, `y(0)=1`, `y'(0)=-1`, using 4 steps of Euler's method, first convert to a system: `y_1' = y_2`, `y_1(0)=1`; `y_2' = \\frac{y_1-y_2}{1+t^2}`, `y_2(0)=-1`.:: sage: RR = RealField(sci_not=0, prec=4, rnd='RNDU') sage: t, x, y=PolynomialRing(RR,3,"txy").gens() sage: f = y; g = (x-y)/(1+t^2) sage: eulers_method_2x2(f,g, 0, 1, -1, 1/4, 1) t x h*f(t,x,y) y h*g(t,x,y) 0 1 -0.25 -1 0.50 1/4 0.75 -0.12 -0.50 0.29 1/2 0.63 -0.054 -0.21 0.19 3/4 0.63 -0.0078 -0.031 0.11 1 0.63 0.020 0.079 0.071 To numerically approximate y(1), where `y''+ty'+y=0`, `y(0)=1`, `y'(0)=0`:: sage: t,x,y=PolynomialRing(RR,3,"txy").gens() sage: f = y; g = -x-y*t sage: eulers_method_2x2(f,g, 0, 1, 0, 1/4, 1) t x h*f(t,x,y) y h*g(t,x,y) 0 1 0.00 0 -0.25 1/4 1.0 -0.062 -0.25 -0.23 1/2 0.94 -0.11 -0.46 -0.17 3/4 0.88 -0.15 -0.62 -0.10 1 0.75 -0.17 -0.68 -0.015 AUTHORS: - David Joyner """ if method=="table": print "%10s %20s %25s %20s %20s"%("t", "x","h*f(t,x,y)","y", "h*g(t,x,y)") n=int((1.0)*(t1-t0)/h) t00 = t0; x00 = x0; y00 = y0 soln = [[t00,x00,y00]] for i in range(n+1): if method=="table": print "%10r %20r %25r %20r %20r"%(t00,x00,h*f(t00,x00,y00),y00,h*g(t00,x00,y00)) x01 = x00 + h*f(t00,x00,y00) y00 = y00 + h*g(t00,x00,y00) x00 = x01 t00 = t00 + h soln.append([t00,x00,y00]) if method!="table": return soln | 103e2c35756877269166b1784fa15fa439c899e5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/103e2c35756877269166b1784fa15fa439c899e5/desolvers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
332,
414,
67,
2039,
67,
22,
92,
22,
12,
74,
16,
75,
16,
268,
20,
16,
619,
20,
16,
677,
20,
16,
366,
16,
268,
21,
16,
2039,
1546,
2121,
6,
4672,
436,
8395,
1220,
4792,
512,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
425,
332,
414,
67,
2039,
67,
22,
92,
22,
12,
74,
16,
75,
16,
268,
20,
16,
619,
20,
16,
677,
20,
16,
366,
16,
268,
21,
16,
2039,
1546,
2121,
6,
4672,
436,
8395,
1220,
4792,
512,
... |
list, tuple, or vector | list, tuple, or vector. | def frame_labels(lower_left, upper_right, label_lower_left, label_upper_right, eps = 1, **kwds): """ Draw correct labels for a given frame in 3D. Primarily used as a helper function for creating frames for 3D graphics viewing - do not use directly unless you know what you are doing! INPUT: - ``lower_left`` - the lower left corner of the frame, as a list, tuple, or vector - ``upper_right`` - the upper right corner of the frame, as a list, tuple, or vector - ``label_lower_left`` - the label for the lower left corner of the frame, as a list, tuple, or vector. This label must actually have all coordinates less than the coordinates of the other label. - ``label_upper_right`` - the label for the upper right corner of the frame, as a list, tuple, or vector. This label must actually have all coordinates greater than the coordinates of the other label. - ``eps`` - (default: 1) a parameter for how far away from the frame to put the labels. Type ``line3d.options`` for a dictionary of the default options for lines, which are also available. EXAMPLES: We can use it directly:: sage: from sage.plot.plot3d.shapes2 import frame_labels sage: frame_labels([1,2,3],[4,5,6],[1,2,3],[4,5,6]) This is usually used for making an actual plot:: sage: y = var('y') sage: P = plot3d(sin(x^2+y^2),(x,0,pi),(y,0,pi)) sage: a,b = P._rescale_for_frame_aspect_ratio_and_zoom(1.0,[1,1,1],1) sage: F = frame_labels(a,b,*P._box_for_aspect_ratio("automatic",a,b)) sage: F.jmol_repr(F.default_render_params())[0] [['select atomno = 1', 'color atom [76,76,76]', 'label "0.0"']] TESTS:: sage: frame_labels([1,2,3],[4,5,6],[1,2,3],[1,3,4]) Traceback (most recent call last): ... ValueError: Ensure the upper right labels are above and to the right of the lower left labels. """ x0,y0,z0 = lower_left x1,y1,z1 = upper_right lx0,ly0,lz0 = label_lower_left lx1,ly1,lz1 = label_upper_right if (lx1 - lx0) <= 0 or (ly1 - ly0) <= 0 or (lz1 - lz0) <= 0: raise ValueError, "Ensure the upper right labels are above and to the right of the lower left labels." # Helper function for formatting the frame labels from math import log log10 = log(10) nd = lambda a: int(log(a)/log10) def fmt_string(a): b = a/2.0 if b >= 1: return "%.1f" n = max(0, 2 - nd(a/2.0)) return "%%.%sf"%n # Slightly faster than mean for this situation def avg(a,b): return (a+b)/2.0 color = (0.3,0.3,0.3) fmt = fmt_string(lx1 - lx0) T = Text(fmt%lx0, color=color).translate((x0,y0-eps,z0)) T += Text(fmt%avg(lx0,lx1), color=color).translate((avg(x0,x1),y0-eps,z0)) T += Text(fmt%lx1, color=color).translate((x1,y0-eps,z0)) fmt = fmt_string(ly1 - ly0) T += Text(fmt%ly0, color=color).translate((x1+eps,y0,z0)) T += Text(fmt%avg(ly0,ly1), color=color).translate((x1+eps,avg(y0,y1),z0)) T += Text(fmt%ly1, color=color).translate((x1+eps,y1,z0)) fmt = fmt_string(lz1 - lz0) T += Text(fmt%lz0, color=color).translate((x0-eps,y0,z0)) T += Text(fmt%avg(lz0,lz1), color=color).translate((x0-eps,y0,avg(z0,z1))) T += Text(fmt%lz1, color=color).translate((x0-eps,y0,z1)) return T | a074a851cc2fcbb495453d24cda3b4b1c0b78eec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9417/a074a851cc2fcbb495453d24cda3b4b1c0b78eec/shapes2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2623,
67,
5336,
12,
8167,
67,
4482,
16,
3854,
67,
4083,
16,
1433,
67,
8167,
67,
4482,
16,
1433,
67,
5797,
67,
4083,
16,
7785,
273,
404,
16,
2826,
25577,
4672,
3536,
10184,
3434,
3249,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2623,
67,
5336,
12,
8167,
67,
4482,
16,
3854,
67,
4083,
16,
1433,
67,
8167,
67,
4482,
16,
1433,
67,
5797,
67,
4083,
16,
7785,
273,
404,
16,
2826,
25577,
4672,
3536,
10184,
3434,
3249,
... |
def extract_entry(self, entry, output_file, destdir=".", correct_file=False): | def extract_entry(self, entry, output_file, destdir=".", correct=False): | def extract_entry(self, entry, output_file, destdir=".", correct_file=False): # process output entry, remove first '/' in entry name fname = string.lower(output_file).replace('/', '', 1) # get directory name for file fname if any dname = os.path.dirname(os.path.join(destdir, fname)) # if dname is a directory and it's not exist, than create it if dname and not os.path.exists(dname): os.makedirs(dname) # otherwise write a file from CHM entry if not os.path.isdir(os.path.join(destdir, fname)): # filename encoding conversion if self.fs_encoding: fname = fname.decode('utf-8').encode(self.fs_encoding) # write CHM entry content into the file, corrected or as is if correct_file: open(os.path.join(destdir, fname), 'w').writelines(CHMEntry(self, entry).correct()) else: open(os.path.join(destdir, fname), 'w').writelines(CHMEntry(self, entry).get()) | 3be63c17aa7dbbb09b4bbf0251add8eba8886698 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5198/3be63c17aa7dbbb09b4bbf0251add8eba8886698/CHM.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
4099,
12,
2890,
16,
1241,
16,
876,
67,
768,
16,
1570,
1214,
1546,
1199,
16,
3434,
33,
8381,
4672,
468,
1207,
876,
1241,
16,
1206,
1122,
2023,
316,
1241,
508,
5299,
273,
533,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
67,
4099,
12,
2890,
16,
1241,
16,
876,
67,
768,
16,
1570,
1214,
1546,
1199,
16,
3434,
33,
8381,
4672,
468,
1207,
876,
1241,
16,
1206,
1122,
2023,
316,
1241,
508,
5299,
273,
533,
... |
print "residual:" | print "values for residual:" | def calcTri3(): """ Calculate damping constants, residual, and Jacobian values for absorbing dampers on mesh with tri3 cells. """ density = 2500.0 vp = 5000.0 vs = 3000.0 velocity = 1.2 edgeLen = 0.5**0.5 dt = 0.25 normal = [0.5**0.5, -0.5**0.5] dampingConsts = [density*vp, density*vs] residualNormal = dampingConsts[0]*velocity*edgeLen/(2.0*dt) residualTangential = dampingConsts[1]*velocity*edgeLen/(2.0*dt) residual = [residualNormal*normal[0] - residualTangential*normal[1], residualNormal*normal[1] + residualTangential*normal[0], residualNormal*normal[0] - residualTangential*normal[1], residualNormal*normal[1] + residualTangential*normal[0]] jacobian = [] print "Absorbing boundary for tri3 mesh" print "damping constants:" for v in dampingConsts: print " %16.8e" % v print "residual:" for v in residual: print " %16.8e" % v | 22636c27c7f957fe66645b65342623f04e386317 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8645/22636c27c7f957fe66645b65342623f04e386317/absorbingdampers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7029,
6251,
23,
13332,
3536,
9029,
302,
931,
310,
6810,
16,
20690,
16,
471,
804,
1077,
26968,
924,
364,
2417,
16640,
310,
302,
931,
414,
603,
6986,
598,
6882,
23,
5983,
18,
3536,
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,
7029,
6251,
23,
13332,
3536,
9029,
302,
931,
310,
6810,
16,
20690,
16,
471,
804,
1077,
26968,
924,
364,
2417,
16640,
310,
302,
931,
414,
603,
6986,
598,
6882,
23,
5983,
18,
3536,
225,
... |
else: fromlang=featured_name.keys() | else: fromlang=featured_name.keys() | def featuredWithInterwiki(fromsite, tosite, template_on_top, pType, quiet, dry = False): if not fromsite.lang in cache: cache[fromsite.lang]={} if not tosite.lang in cache[fromsite.lang]: cache[fromsite.lang][tosite.lang]={} cc=cache[fromsite.lang][tosite.lang] if nocache: cc={} templatelist = getTemplateList(tosite.lang, pType) findtemplate = '(' + '|'.join(templatelist) + ')' re_Link_FA=re.compile(ur"\{\{%s\|%s\}\}" % (findtemplate.replace(u' ', u'[ _]'), fromsite.lang), re.IGNORECASE) re_this_iw=re.compile(ur"\[\[%s:[^]]+\]\]" % fromsite.lang) arts=featuredArticles(fromsite, pType) pairs=[] for a in arts: if a.title()<afterpage: continue if u"/" in a.title() and a.namespace() != 0: wikipedia.output(u"%s is a subpage" % a.title()) continue if a.title() in cc: wikipedia.output(u"(cached) %s -> %s"%(a.title(), cc[a.title()])) continue if a.isRedirectPage(): a=a.getRedirectTarget() try: if not a.exists(): wikipedia.output(u"source page doesn't exist: %s" % a.title()) continue atrans = findTranslated(a, tosite, quiet) if atrans: text=atrans.get() m=re_Link_FA.search(text) if m: wikipedia.output(u"(already done)") else: # insert just before interwiki if (not interactive or wikipedia.input(u'Connecting %s -> %s. Proceed? [Y/N]'%(a.title(), atrans.title())) in ['Y','y'] ): m=re_this_iw.search(text) if not m: wikipedia.output(u"no interwiki record, very strange") continue site = wikipedia.getSite() if pType == 'good': comment = wikipedia.setAction(wikipedia.translate(site, msg_good) % (fromsite.lang, a.title())) elif pType == 'list': comment = wikipedia.setAction(wikipedia.translate(site, msg_lists) % (fromsite.lang, a.title())) else: comment = wikipedia.setAction(wikipedia.translate(site, msg) % (fromsite.lang, a.title())) ### Moving {{Link FA|xx}} to top of interwikis ### if template_on_top == True: # Getting the interwiki iw = wikipedia.getLanguageLinks(text, site) # Removing the interwiki text = wikipedia.removeLanguageLinks(text, site) text += u"\r\n{{%s|%s}}\r\n"%(templatelist[0], fromsite.lang) # Adding the interwiki text = wikipedia.replaceLanguageLinks(text, iw, site) ### Placing {{Link FA|xx}} right next to corresponding interwiki ### else: text=(text[:m.end()] + (u" {{%s|%s}}" % (templatelist[0], fromsite.lang)) + text[m.end():]) if not dry: try: atrans.put(text, comment) except wikipedia.LockedPage: wikipedia.output(u'Page %s is locked!' % atrans.title()) cc[a.title()]=atrans.title() except wikipedia.PageNotSaved, e: wikipedia.output(u"Page not saved") | 7696652d8fe28dea8c886308578a3771b6c7cfe9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/7696652d8fe28dea8c886308578a3771b6c7cfe9/featured.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2572,
72,
1190,
2465,
13044,
12,
2080,
4256,
16,
358,
4256,
16,
1542,
67,
265,
67,
3669,
16,
29171,
16,
10902,
16,
10299,
273,
1083,
4672,
309,
486,
628,
4256,
18,
4936,
316,
1247,
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,
2572,
72,
1190,
2465,
13044,
12,
2080,
4256,
16,
358,
4256,
16,
1542,
67,
265,
67,
3669,
16,
29171,
16,
10902,
16,
10299,
273,
1083,
4672,
309,
486,
628,
4256,
18,
4936,
316,
1247,
30,... |
url = '%s.html imclass.__module__, imclass.__name__, name) note = ' from <a href="%s">%s</a>' % ( url, classname(imclass, mod)) | note = ' from ' + self.classlink(imclass, mod) | def docroutine(self, object, name=None, mod=None, funcs={}, classes={}, methods={}, cl=None): """Produce HTML documentation for a function or method object.""" realname = object.__name__ name = name or realname anchor = (cl and cl.__name__ or '') + '-' + name note = '' skipdocs = 0 if inspect.ismethod(object): imclass = object.im_class if cl: if imclass is not cl: url = '%s.html#%s-%s' % ( imclass.__module__, imclass.__name__, name) note = ' from <a href="%s">%s</a>' % ( url, classname(imclass, mod)) skipdocs = 1 else: inst = object.im_self note = (inst and ' method of %s instance' % classname(inst.__class__, mod) or ' unbound %s method' % classname(imclass, mod)) object = object.im_func | a5cd89f93dfc2b451a5a589ac3cd84fbcdd53c4f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/a5cd89f93dfc2b451a5a589ac3cd84fbcdd53c4f/pydoc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
22640,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
681,
33,
7036,
16,
15630,
28793,
3318,
28793,
2590,
28793,
927,
33,
7036,
4672,
3536,
25884,
3982,
7323,
364,
279,
445,
578,
707,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
997,
22640,
12,
2890,
16,
733,
16,
508,
33,
7036,
16,
681,
33,
7036,
16,
15630,
28793,
3318,
28793,
2590,
28793,
927,
33,
7036,
4672,
3536,
25884,
3982,
7323,
364,
279,
445,
578,
707,
... |
contextMibInstrumCtl = self.snmpContext.getMibInstrum( | contextMibInstrumCtl = self.__context.getMibInstrum( | def sendNotification( self, snmpEngine, notificationTarget, notificationName, additionalNames=None, contextName='', cbFun=None, cbCtx=None ): # 3.3 ( notifyTag, notifyType ) = config.getNotificationInfo( snmpEngine, notificationTarget ) pendingReqsCount = { 0: 0 } for targetAddrName in config.getTargetNames(snmpEngine, notifyTag): ( transportDomain, transportAddress, timeout, retryCount, params ) = config.getTargetAddr(snmpEngine, targetAddrName) ( messageProcessingModel, securityModel, securityName, securityLevel ) = config.getTargetParams(snmpEngine, params) | 2ef6d66432dc958997df2634ee4c2d01795d156e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/587/2ef6d66432dc958997df2634ee4c2d01795d156e/ntforg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
4386,
12,
365,
16,
15366,
4410,
16,
3851,
2326,
16,
3851,
461,
16,
3312,
1557,
33,
7036,
16,
819,
461,
2218,
2187,
2875,
22783,
33,
7036,
16,
2875,
6442,
33,
7036,
262,
30,
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,
1366,
4386,
12,
365,
16,
15366,
4410,
16,
3851,
2326,
16,
3851,
461,
16,
3312,
1557,
33,
7036,
16,
819,
461,
2218,
2187,
2875,
22783,
33,
7036,
16,
2875,
6442,
33,
7036,
262,
30,
468,
... |
self.clearCtrls(self.styleNum == wxSTC_STYLE_DEFAULT, | self.clearCtrls(self.styleNum == wx.stc.STC_STYLE_DEFAULT, | def populateCtrls(self): self.clearCtrls(self.styleNum == wxSTC_STYLE_DEFAULT, disableDefs=self.styleNum < 0) | 1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12725/1e19321bfb8d6ff348cd85bdad3a1a4c2f517fa0/STCStyleEditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
39,
313,
3251,
12,
2890,
4672,
365,
18,
8507,
39,
313,
3251,
12,
2890,
18,
4060,
2578,
422,
7075,
18,
334,
71,
18,
882,
39,
67,
15066,
67,
5280,
16,
4056,
14554,
33,
2890,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
39,
313,
3251,
12,
2890,
4672,
365,
18,
8507,
39,
313,
3251,
12,
2890,
18,
4060,
2578,
422,
7075,
18,
334,
71,
18,
882,
39,
67,
15066,
67,
5280,
16,
4056,
14554,
33,
2890,
18,
... |
libc = CDLL('libc.so.6') | from pypy.rpython.lltypesystem.ll2ctypes import libc_name libc = CDLL(libc_name) | def test_call_to_c_function(self): from pypy.rlib.libffi import CDLL, types, ArgChain libc = CDLL('libc.so.6') c_tolower = libc.getpointer('tolower', [types.uchar], types.sint) argchain = ArgChain().arg(ord('A')) assert c_tolower.call(argchain, rffi.INT) == ord('a') | 5406748b8bc9d1384ded655c623d40be88d5a02c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/5406748b8bc9d1384ded655c623d40be88d5a02c/runner_test.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1991,
67,
869,
67,
71,
67,
915,
12,
2890,
4672,
628,
18951,
93,
18,
1321,
495,
18,
2941,
1403,
77,
1930,
21508,
4503,
16,
1953,
16,
14448,
3893,
628,
18951,
93,
18,
86,
810... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1991,
67,
869,
67,
71,
67,
915,
12,
2890,
4672,
628,
18951,
93,
18,
1321,
495,
18,
2941,
1403,
77,
1930,
21508,
4503,
16,
1953,
16,
14448,
3893,
628,
18951,
93,
18,
86,
810... |
'report.comprobante.retencion.islr', 'account.retencion.islr', 'addons/retencion_islr/report/comprobante_islr.rml', parser=rep_comprobante_islr, | 'report.comprobante.retencion.munici', 'account.retencion.munici', 'addons/retencion_munici/report/comprobante_munici.rml', parser=rep_comprobante_munici, | def _get_rif(self, vat=''): if not vat: return [] return vat[2:].replace(' ', '') | 6a00c58d9509a8b177f3c5664846d8bb96ad1399 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7359/6a00c58d9509a8b177f3c5664846d8bb96ad1399/comprobante_munici.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
86,
430,
12,
2890,
16,
17359,
2218,
11,
4672,
309,
486,
17359,
30,
327,
5378,
327,
17359,
63,
22,
30,
8009,
2079,
2668,
2265,
28707,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
67,
86,
430,
12,
2890,
16,
17359,
2218,
11,
4672,
309,
486,
17359,
30,
327,
5378,
327,
17359,
63,
22,
30,
8009,
2079,
2668,
2265,
28707,
2,
-100,
-100,
-100,
-100,
-100,
-100... |
if (packages.ZipPackage(request, os.path.join(attach_dir, file).encode(config.charset)).isPackage() and request.user.isSuperUser() and request.user.may.write(pagename)): viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&do=install&target=%(urlfile)s">%(label_install)s</a>' % parmdict elif (zipfile.is_zipfile(os.path.join(attach_dir, file).encode(config.charset)) and mt.minor == 'zip' and request.user.may.read(pagename) and request.user.may.delete(pagename) and request.user.may.write(pagename)): viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&do=unzip&target=%(urlfile)s">%(label_unzip)s</a>' % parmdict | is_zipfile = zipfile.is_zipfile(os.path.join(attach_dir, file).encode(config.charset)) if is_zipfile: is_package = packages.ZipPackage(request, os.path.join(attach_dir, file).encode(config.charset)).isPackage() if is_package and request.user.isSuperUser(): viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&do=install&target=%(urlfile)s">%(label_install)s</a>' % parmdict elif (not is_package and mt.minor == 'zip' and request.user.may.read(pagename) and request.user.may.delete(pagename) and request.user.may.write(pagename)): viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&do=unzip&target=%(urlfile)s">%(label_unzip)s</a>' % parmdict | def _build_filelist(request, pagename, showheader, readonly, mime_type='*'): _ = request.getText # access directory attach_dir = getAttachDir(request, pagename) files = _get_files(request, pagename) if mime_type != '*': files = [fname for fname in files if mime_type == mimetypes.guess_type(fname)[0]] html = "" if files: if showheader: html += _( "To refer to attachments on a page, use '''{{{attachment:filename}}}''', \n" "as shown below in the list of files. \n" "Do '''NOT''' use the URL of the {{{[get]}}} link, \n" "since this is subject to change and can break easily." ) html += "<ul>" label_del = _("del") label_move = _("move") label_get = _("get") label_edit = _("edit") label_view = _("view") label_unzip = _("unzip") label_install = _("install") for file in files: mt = wikiutil.MimeType(filename=file) st = os.stat(os.path.join(attach_dir, file).encode(config.charset)) fsize = "%.1f" % (float(st.st_size) / 1024) fmtime = request.user.getFormattedDateTime(st.st_mtime) baseurl = request.getScriptname() action = action_name urlpagename = wikiutil.quoteWikinameURL(pagename) urlfile = wikiutil.url_quote_plus(file) base, ext = os.path.splitext(file) get_url = getAttachUrl(pagename, file, request, escaped=1) escaped_fname = wikiutil.escape(file) parmdict = {'baseurl': baseurl, 'urlpagename': urlpagename, 'action': action, 'urlfile': urlfile, 'label_del': label_del, 'label_move': label_move, 'base': base, 'label_edit': label_edit, 'label_view': label_view, 'label_unzip': label_unzip, 'label_install': label_install, 'get_url': get_url, 'label_get': label_get, 'file': escaped_fname, 'fsize': fsize, 'fmtime': fmtime, 'pagename': pagename} del_link = '' if request.user.may.delete(pagename) and not readonly: del_link = '<a href="%(baseurl)s/%(urlpagename)s' \ '?action=%(action)s&do=del&target=%(urlfile)s">%(label_del)s</a> | ' % parmdict if request.user.may.delete(pagename) and not readonly: move_link = '<a href="%(baseurl)s/%(urlpagename)s' \ '?action=%(action)s&do=move&target=%(urlfile)s">%(label_move)s</a> | ' % parmdict else: move_link = '' if ext == '.draw': viewlink = '<a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&drawing=%(base)s">%(label_edit)s</a>' % parmdict else: viewlink = '<a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&do=view&target=%(urlfile)s">%(label_view)s</a>' % parmdict if (packages.ZipPackage(request, os.path.join(attach_dir, file).encode(config.charset)).isPackage() and request.user.isSuperUser() and request.user.may.write(pagename)): viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&do=install&target=%(urlfile)s">%(label_install)s</a>' % parmdict elif (zipfile.is_zipfile(os.path.join(attach_dir, file).encode(config.charset)) and mt.minor == 'zip' and request.user.may.read(pagename) and request.user.may.delete(pagename) and request.user.may.write(pagename)): viewlink += ' | <a href="%(baseurl)s/%(urlpagename)s?action=%(action)s&do=unzip&target=%(urlfile)s">%(label_unzip)s</a>' % parmdict parmdict['viewlink'] = viewlink parmdict['del_link'] = del_link parmdict['move_link'] = move_link html += ('<li>[%(del_link)s%(move_link)s' '<a href="%(get_url)s">%(label_get)s</a> | %(viewlink)s]' ' (%(fmtime)s, %(fsize)s KB) [[attachment:%(file)s]]</li>') % parmdict html += "</ul>" else: if showheader: html += '<p>%s</p>' % (_("No attachments stored for %(pagename)s") % {'pagename': wikiutil.escape(pagename)}) return html | 89748417ba203bb8a4ab98c0aaca0c0021e87d69 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/89748417ba203bb8a4ab98c0aaca0c0021e87d69/AttachFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3510,
67,
7540,
5449,
12,
2293,
16,
4262,
1069,
16,
2405,
3374,
16,
17102,
16,
4892,
67,
723,
2218,
4035,
4672,
389,
273,
590,
18,
588,
1528,
225,
468,
2006,
1867,
3306,
67,
1214,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3510,
67,
7540,
5449,
12,
2293,
16,
4262,
1069,
16,
2405,
3374,
16,
17102,
16,
4892,
67,
723,
2218,
4035,
4672,
389,
273,
590,
18,
588,
1528,
225,
468,
2006,
1867,
3306,
67,
1214,... |
else: completing_from = False | def complete(line, cw): """Construct a full list of possibly completions for imports.""" tokens = line.split() if tokens[0] in ['from', 'import']: if tokens[0] == 'from': completing_from = True if len(tokens) > 3: if '.' in cw: # This will result in a SyntaxError, so do not return # any matches return list() cw = '%s.%s' % (tokens[1], cw) elif len(tokens) == 3: return ['import'] else: completing_from = False matches = list() for name in modules: if not (name.startswith(cw) and name.find('.', len(cw)) == -1): continue if completing_from: name = name[len(tokens[1]) + 1:] matches.append(name) return matches else: return list() | 399692f79e8a621b111c84a9b96e7d768128a811 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6932/399692f79e8a621b111c84a9b96e7d768128a811/importcompletion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
12,
1369,
16,
14098,
4672,
3536,
7249,
279,
1983,
666,
434,
10016,
23738,
364,
10095,
12123,
2430,
273,
980,
18,
4939,
1435,
309,
2430,
63,
20,
65,
316,
10228,
2080,
2187,
296,
566... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3912,
12,
1369,
16,
14098,
4672,
3536,
7249,
279,
1983,
666,
434,
10016,
23738,
364,
10095,
12123,
2430,
273,
980,
18,
4939,
1435,
309,
2430,
63,
20,
65,
316,
10228,
2080,
2187,
296,
566... | |
self.tooltips.set_tip(button, _("Increment each selected music file, starting at track 1 for this file.")) | button.set_tooltip_text(_("Increment each selected music file, starting at track 1 for this file.")) | def tags_win_create_apply_all_button(self, button, vbox, entry, autotrack=False): button.set_size_request(12, 12) if autotrack: self.tooltips.set_tip(button, _("Increment each selected music file, starting at track 1 for this file.")) else: self.tooltips.set_tip(button, _("Apply to all selected music files.")) padding = int((entry.size_request()[1] - button.size_request()[1])/2)+1 vbox.pack_start(button, False, False, padding) | 5178d7eb73657d7ee78706340fbf0fc5d779c7ee /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2312/5178d7eb73657d7ee78706340fbf0fc5d779c7ee/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2342,
67,
8082,
67,
2640,
67,
9010,
67,
454,
67,
5391,
12,
2890,
16,
3568,
16,
331,
2147,
16,
1241,
16,
3656,
4101,
33,
8381,
4672,
3568,
18,
542,
67,
1467,
67,
2293,
12,
2138,
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,
2342,
67,
8082,
67,
2640,
67,
9010,
67,
454,
67,
5391,
12,
2890,
16,
3568,
16,
331,
2147,
16,
1241,
16,
3656,
4101,
33,
8381,
4672,
3568,
18,
542,
67,
1467,
67,
2293,
12,
2138,
16,
... |
if chatty: print " | if chatty < 20: print " | def selectDefaultPrefix(self, context): | 33ad1544437afd2399261e63a6cae3c8e2d6e52d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3308/33ad1544437afd2399261e63a6cae3c8e2d6e52d/cwm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
1868,
2244,
12,
2890,
16,
819,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2027,
1868,
2244,
12,
2890,
16,
819,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
('datafile-dir=', None, "override where schooltool thinks its " "data files are")] | ('datafile-dir=', None, "override where the python libraries think" " their data files are")] | def run(self): """Record where we have installed the data files""" # we have to make sure the build directory is around self.run_command('build') # write where we have installed the data files to build/data_base try: data_file = open(os.path.join(self.build_base, self.package + '_data_base'), 'w') data_file.write(os.path.abspath(self.install_dir)) finally: data_file.close() return _install_data.run(self) | 7e86c9ed7a2671f488d0391e7d7ede4a68f750b4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7127/7e86c9ed7a2671f488d0391e7d7ede4a68f750b4/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
3536,
2115,
1625,
732,
1240,
5876,
326,
501,
1390,
8395,
468,
732,
1240,
358,
1221,
3071,
326,
1361,
1867,
353,
6740,
365,
18,
2681,
67,
3076,
2668,
3510,
6134,
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,
1086,
12,
2890,
4672,
3536,
2115,
1625,
732,
1240,
5876,
326,
501,
1390,
8395,
468,
732,
1240,
358,
1221,
3071,
326,
1361,
1867,
353,
6740,
365,
18,
2681,
67,
3076,
2668,
3510,
6134,
468... |
for attr in ['memory_total', 'memory_free', | for attr in ['memory_total', 'memory_free', 'memory_dom0', | def _ComputeClusterData(self): """Compute the generic allocator input data. | b2662e7f22f9fad8a4484dd172573c3f4672c031 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/b2662e7f22f9fad8a4484dd172573c3f4672c031/cmdlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7018,
3629,
751,
12,
2890,
4672,
3536,
7018,
326,
5210,
26673,
810,
501,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7018,
3629,
751,
12,
2890,
4672,
3536,
7018,
326,
5210,
26673,
810,
501,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
iq.y = game.state.kscmdr.y | iq.j = game.state.kscmdr.j | def supercommander(): "Move the Super Commander." iq = coord(); sc = coord(); ibq = coord(); idelta = coord() basetbl = [] if idebug: prout("== SUPERCOMMANDER") # Decide on being active or passive avoid = ((game.incom - len(game.state.kcmdr) + game.inkling - game.state.remkl)/(game.state.date+0.01-game.indate) < 0.1*game.skill*(game.skill+1.0) or \ (game.state.date-game.indate) < 3.0) if not game.iscate and avoid: # compute move away from Enterprise idelta = game.state.kscmdr-game.quadrant if math.sqrt(idelta.x*idelta.x+idelta.y*idelta.y) > 2.0: # circulate in space idelta.x = game.state.kscmdr.y-game.quadrant.y idelta.y = game.quadrant.x-game.state.kscmdr.x else: # compute distances to starbases if not game.state.baseq: # nothing left to do unschedule(FSCMOVE) return sc = game.state.kscmdr for base in game.state.baseq: basetbl.append((i, (base - sc).distance())) if game.state.baseq > 1: basetbl.sort(lambda x, y: cmp(x[1]. y[1])) # look for nearest base without a commander, no Enterprise, and # without too many Klingons, and not already under attack. ifindit = iwhichb = 0 for (i2, base) in enumerate(game.state.baseq): i = basetbl[i2][0]; # bug in original had it not finding nearest if base==game.quadrant or base==game.battle or not welcoming(base): continue # if there is a commander, and no other base is appropriate, # we will take the one with the commander for cmdr in game.state.kcmdr: if base == cmdr and ifindit != 2: ifindit = 2 iwhichb = i break else: # no commander -- use this one ifindit = 1 iwhichb = i break if ifindit==0: return # Nothing suitable -- wait until next time ibq = game.state.baseq[iwhichb] # decide how to move toward base idelta = ibq - game.state.kscmdr # Maximum movement is 1 quadrant in either or both axes idelta = idelta.sgn() # try moving in both x and y directions # there was what looked like a bug in the Almy C code here, # but it might be this translation is just wrong. iq = game.state.kscmdr + idelta if movescom(iq, avoid): # failed -- try some other maneuvers if idelta.x==0 or idelta.y==0: # attempt angle move if idelta.x != 0: iq.y = game.state.kscmdr.y + 1 if movescom(iq, avoid): iq.y = game.state.kscmdr.y - 1 movescom(iq, avoid) else: iq.x = game.state.kscmdr.x + 1 if movescom(iq, avoid): iq.x = game.state.kscmdr.x - 1 movescom(iq, avoid) else: # try moving just in x or y iq.y = game.state.kscmdr.y if movescom(iq, avoid): iq.y = game.state.kscmdr.y + idelta.y iq.x = game.state.kscmdr.x movescom(iq, avoid) # check for a base if len(game.state.baseq) == 0: unschedule(FSCMOVE) else: for (i, ibq) in enumerate(game.state.baseq): if ibq == game.state.kscmdr and game.state.kscmdr == game.battle: # attack the base if avoid: return # no, don't attack base! game.iseenit = False game.isatb = 1 schedule(FSCDBAS, randreal(1.0, 3.0)) if is_scheduled(FCDBAS): postpone(FSCDBAS, scheduled(FCDBAS)-game.state.date) if not communicating(): return # no warning game.iseenit = True announce() prout(_("Lt. Uhura- \"Captain, the starbase in Quadrant %s") \ % game.state.kscmdr) prout(_(" reports that it is under attack from the Klingon Super-commander.")) proutn(_(" It can survive until stardate %d.\"") \ % int(scheduled(FSCDBAS))) if not game.resting: return prout(_("Mr. Spock- \"Captain, shall we cancel the rest period?\"")) if ja() == False: return game.resting = False game.optime = 0.0; # actually finished return # Check for intelligence report if not idebug and \ (withprob(0.8) or \ (not communicating()) or \ not game.state.galaxy[game.state.kscmdr.x][game.state.kscmdr.y].charted): return announce() prout(_("Lt. Uhura- \"Captain, Starfleet Intelligence reports")) proutn(_(" the Super-commander is in Quadrant %s,") % game.state.kscmdr) return | e67cf36a789c4ab1cd905a9a08e91d219395f538 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/e67cf36a789c4ab1cd905a9a08e91d219395f538/sst.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2240,
3076,
264,
13332,
315,
7607,
326,
14845,
3498,
264,
1199,
24288,
273,
2745,
5621,
888,
273,
2745,
5621,
9834,
85,
273,
2745,
5621,
612,
8967,
273,
2745,
1435,
2580,
278,
3083,
273,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2240,
3076,
264,
13332,
315,
7607,
326,
14845,
3498,
264,
1199,
24288,
273,
2745,
5621,
888,
273,
2745,
5621,
9834,
85,
273,
2745,
5621,
612,
8967,
273,
2745,
1435,
2580,
278,
3083,
273,
... |
image_orientation_label = self.groups_dcm.keys()[3] | image_orientation_label = self.groups_dcm.keys()[x][3] | def __UpdateZSpacing(self): """ Calculate Z spacing from slices """ | e3a213afd33c8006c4c193b4368c67c640361400 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10228/e3a213afd33c8006c4c193b4368c67c640361400/dicom_grouper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1891,
62,
18006,
12,
2890,
4672,
3536,
9029,
2285,
13259,
628,
12390,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
1001,
1891,
62,
18006,
12,
2890,
4672,
3536,
9029,
2285,
13259,
628,
12390,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
self._report_new_message(currentStdout.getvalue()) | stdoutData = currentStdout.getvalue().strip() if stdoutData: self._report_new_message(stdoutData) | def Send(self, messageType, text): if messageType != telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL: raise telepathy.errors.NotImplemented("Unhandled message type: %r" % messageType) | ce6adeabb24eb8be45a8278ae4b03134e81191d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13096/ce6adeabb24eb8be45a8278ae4b03134e81191d9/debug_prompt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2479,
12,
2890,
16,
22402,
16,
977,
4672,
309,
22402,
480,
268,
6516,
803,
93,
18,
15814,
67,
5151,
67,
8723,
67,
2399,
67,
15480,
30,
1002,
268,
6516,
803,
93,
18,
4324,
18,
1248,
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,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2479,
12,
2890,
16,
22402,
16,
977,
4672,
309,
22402,
480,
268,
6516,
803,
93,
18,
15814,
67,
5151,
67,
8723,
67,
2399,
67,
15480,
30,
1002,
268,
6516,
803,
93,
18,
4324,
18,
1248,
8... |
subprocess.call([exe, '-v'], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w')) return exe | exe = os.path.join(cg_root, exe_path) return_code = subprocess.call([exe, '-v'], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w')) if return_code == 0 or return_code == 1: return exe | def default_cgc(): paths = [ '/usr/bin/cgc', 'C:/Program Files/NVIDIA Corporation/Cg/bin/cgc.exe', 'C:/Program Files (x86)/NVIDIA Corporation/Cg/bin/cgc.exe' ] for path in paths: if os.path.exists(path): return path script_path = os.path.abspath(sys.path[0]) # Try again looking in the current working directory to match # the layout of the prebuilt o3dConverter binaries. cur_dir_paths = [ os.path.join(script_path, 'cgc'), os.path.join(script_path, 'cgc.exe') ] for path in cur_dir_paths: if (os.path.exists(path)): return path # Last fallback is to use the binaries in o3d/third_party/cg/files. # Unfortunately, because we can't rely on the OS name, we have to # actually try running the cgc executable. o3d_root = find_o3d_root(); cg_root = os.path.join(o3d_root, 'third_party', 'cg', 'files') exes = [ os.path.join(cg_root, 'linux', 'bin', 'cgc'), os.path.join(cg_root, 'linux', 'bin64', 'cgc'), os.path.join(cg_root, 'mac', 'bin', 'cgc'), os.path.join(cg_root, 'win', 'bin', 'cgc.exe') ] for exe in exes: try: subprocess.call([exe, '-v'], stdout=open(os.devnull, 'w'), stderr=open(os.devnull, 'w')) return exe except: pass # We don't know where cgc lives. return '' | 2a3a06654561be5d0a871c950e7a791bea57bb75 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/2a3a06654561be5d0a871c950e7a791bea57bb75/convert.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
71,
13241,
13332,
2953,
273,
306,
1173,
13640,
19,
4757,
19,
71,
13241,
2187,
296,
39,
27824,
9459,
6471,
19,
11679,
734,
15188,
9557,
11390,
19,
39,
75,
19,
4757,
19,
71,
132... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
805,
67,
71,
13241,
13332,
2953,
273,
306,
1173,
13640,
19,
4757,
19,
71,
13241,
2187,
296,
39,
27824,
9459,
6471,
19,
11679,
734,
15188,
9557,
11390,
19,
39,
75,
19,
4757,
19,
71,
132... |
(e, o) = commands.statusoutput('which apt-file') if e != 0: | if commands.getstatusoutput('which apt-file') != 0: | def anything(prompt, default=None): """Because supybot is pure fail""" from supybot.questions import expect return expect(prompt, [], default=default) | b2193d52ad9353e3581ae854c5da52d2073f1610 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3102/b2193d52ad9353e3581ae854c5da52d2073f1610/config.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6967,
12,
13325,
16,
805,
33,
7036,
4672,
3536,
38,
11884,
1169,
93,
4819,
353,
16618,
2321,
8395,
628,
1169,
93,
4819,
18,
9758,
1930,
4489,
327,
4489,
12,
13325,
16,
5378,
16,
805,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6967,
12,
13325,
16,
805,
33,
7036,
4672,
3536,
38,
11884,
1169,
93,
4819,
353,
16618,
2321,
8395,
628,
1169,
93,
4819,
18,
9758,
1930,
4489,
327,
4489,
12,
13325,
16,
5378,
16,
805,
3... |
raise ValueError,\ | raise ValueError, \ | def setData(self, *dataList, **options): """ Set data to the plot | cd4aefd6501a46432131840f7455b36b75e33c79 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8476/cd4aefd6501a46432131840f7455b36b75e33c79/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7929,
12,
2890,
16,
380,
892,
682,
16,
2826,
2116,
4672,
3536,
1000,
501,
358,
326,
3207,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7929,
12,
2890,
16,
380,
892,
682,
16,
2826,
2116,
4672,
3536,
1000,
501,
358,
326,
3207,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
logger.info("Quota for: " + uid + " - " + ldapquota) | logger.debug("Quota for: " + uid + " - " + ldapquota) | def setDiskQuota(self, uid, device, quota, overwrite = "all",single = True): logger = logging.getLogger() logger.info("received quota for " + uid + ", device: " + device + ", size: " + quota) blocks = self.convertMBtoBlocks(quota, device); softblocks = int (blocks * self.configuserquota.softquotablocks) inodes = int(blocks * self.configuserquota.inodesperblock) softinodes = int(inodes * self.configuserquota.softquotainodes) devicepath = device.split(':')[0] | c1b148277eaa33380684c03817015cbdb8ea5c22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/c1b148277eaa33380684c03817015cbdb8ea5c22/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
6247,
10334,
12,
2890,
16,
4555,
16,
2346,
16,
13257,
16,
6156,
273,
315,
454,
3113,
7526,
273,
1053,
4672,
1194,
273,
2907,
18,
588,
3328,
1435,
1194,
18,
1376,
2932,
15213,
13257,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
6247,
10334,
12,
2890,
16,
4555,
16,
2346,
16,
13257,
16,
6156,
273,
315,
454,
3113,
7526,
273,
1053,
4672,
1194,
273,
2907,
18,
588,
3328,
1435,
1194,
18,
1376,
2932,
15213,
13257,... |
self.Close() | self._port_handle.Close() | def close(self): """Close port""" if self._isOpen: if self._port_handle: try: self.Close() except System.IO.Ports.InvalidOperationException: # ignore errors. can happen for unplugged USB serial devices pass self._port_handle = None self._isOpen = False | d40fa4acd709af2126b92f5562e2ffdd28a1926e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10955/d40fa4acd709af2126b92f5562e2ffdd28a1926e/serialcli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
3536,
4605,
1756,
8395,
309,
365,
6315,
291,
3678,
30,
309,
365,
6315,
655,
67,
4110,
30,
775,
30,
365,
6315,
655,
67,
4110,
18,
4605,
1435,
1335,
2332,
18,
4294,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1746,
12,
2890,
4672,
3536,
4605,
1756,
8395,
309,
365,
6315,
291,
3678,
30,
309,
365,
6315,
655,
67,
4110,
30,
775,
30,
365,
6315,
655,
67,
4110,
18,
4605,
1435,
1335,
2332,
18,
4294,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.