rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
if self.distro.osversion.osmajor in recipetask.task.excluded_osmajor: | if self.distro.osversion.osmajor in [osmajor.osmajor for osmajor in recipetask.task.excluded_osmajor]: | def append_tasks(self, recipetask): """ Before appending the task to this Recipe, make sure it applies. ie: not excluded for this distro family or arch. """ if self.distro.arch in recipetask.task.excluded_arch: return if self.distro.osversion.osmajor in recipetask.task.excluded_osmajor: return self.tasks.append(recipetask) | 9f52ef3083e1f8a21a5708775674228ad2c6dbec /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14755/9f52ef3083e1f8a21a5708775674228ad2c6dbec/model.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
67,
9416,
12,
2890,
16,
5863,
278,
835,
4672,
3536,
11672,
19997,
326,
1562,
358,
333,
7776,
3151,
16,
1221,
3071,
518,
10294,
18,
9228,
30,
486,
8845,
364,
333,
27450,
6755,
578,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
67,
9416,
12,
2890,
16,
5863,
278,
835,
4672,
3536,
11672,
19997,
326,
1562,
358,
333,
7776,
3151,
16,
1221,
3071,
518,
10294,
18,
9228,
30,
486,
8845,
364,
333,
27450,
6755,
578,
... |
self.moviePrevFrameAction.setIconSet(QIconSet(self.image104)) | self.moviePrevFrameAction.setIconSet(QIconSet(self.image101)) | def __init__(self,parent = None,name = None,fl = 0): QMainWindow.__init__(self,parent,name,fl) self.statusBar() | e48e859515237593d94b403a9c0a7295e08c31f2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/e48e859515237593d94b403a9c0a7295e08c31f2/MainWindowUI.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2938,
273,
599,
16,
529,
273,
599,
16,
2242,
273,
374,
4672,
2238,
6376,
3829,
16186,
2738,
972,
12,
2890,
16,
2938,
16,
529,
16,
2242,
13,
365,
18,
23... |
s = xmlrpclib.ServerProxy(settings.OPENX_URL, verbose=True) | s = xmlrpclib.ServerProxy(settings.OPENX_URL) | def _session(self): if self.__session is None: s = xmlrpclib.ServerProxy(settings.OPENX_URL, verbose=True) self.__session = s.ox.logon(settings.OPENX_USERNAME, settings.OPENX_PASSWORD) return self.__session | ec1c93f3e060144b1a52626ced15aac061cafeb8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4929/ec1c93f3e060144b1a52626ced15aac061cafeb8/client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3184,
12,
2890,
4672,
309,
365,
16186,
3184,
353,
599,
30,
272,
273,
2025,
13832,
830,
495,
18,
2081,
3886,
12,
4272,
18,
11437,
60,
67,
1785,
13,
365,
16186,
3184,
273,
272,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3184,
12,
2890,
4672,
309,
365,
16186,
3184,
353,
599,
30,
272,
273,
2025,
13832,
830,
495,
18,
2081,
3886,
12,
4272,
18,
11437,
60,
67,
1785,
13,
365,
16186,
3184,
273,
272,
18,
... |
xm_file.open(xm_path, "w") | xm_file = open(xm_path, "w") | def call_old_bibformat(recID, format="HD", on_the_fly=False, verbose=0): """ FIXME: REMOVE FUNCTION WHEN MIGRATION IS DONE Calls BibFormat for the record RECID in the desired output format FORMAT. @param on_the_fly if False, try to return an already preformatted version of the record in the database Note: this functions always try to return HTML, so when bibformat returns XML with embedded HTML format inside the tag FMT $g, as is suitable for prestoring output formats, we perform un-XML-izing here in order to return HTML body only. """ out = "" res = [] if not on_the_fly: # look for formatted notice existence: query = "SELECT value, last_updated FROM bibfmt WHERE "\ "id_bibrec='%s' AND format='%s'" % (recID, format) res = run_sql(query, None, 1) if res: # record 'recID' is formatted in 'format', so print it if verbose == 9: last_updated = res[0][1] out += """\n<br/><span class="quicknote"> Found preformatted output for record %i (cache updated on %s). </span>""" % (recID, last_updated) decompress = zlib.decompress return "%s" % decompress(res[0][0]) else: # record 'recID' is not formatted in 'format', # so try to call BibFormat on the fly or use default format: if verbose == 9: out += """\n<br/><span class="quicknote"> Formatting record %i on-the-fly with old BibFormat. </span><br/>""" % recID | a268b4a002ac967f063aa877f813b73a5397feaa /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2763/a268b4a002ac967f063aa877f813b73a5397feaa/bibformat_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
745,
67,
1673,
67,
70,
495,
2139,
12,
3927,
734,
16,
740,
1546,
44,
40,
3113,
603,
67,
5787,
67,
29670,
33,
8381,
16,
3988,
33,
20,
4672,
3536,
9852,
30,
26056,
13690,
29707,
490,
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,
745,
67,
1673,
67,
70,
495,
2139,
12,
3927,
734,
16,
740,
1546,
44,
40,
3113,
603,
67,
5787,
67,
29670,
33,
8381,
16,
3988,
33,
20,
4672,
3536,
9852,
30,
26056,
13690,
29707,
490,
30... |
url = mlist.GetAbsoluteOptionsURL(addr) | url = mlist.GetOptionsURL(addr, relative=1) | def optionslinks(listname, user=user): mlist = MailList.MailList(listname, lock=0) addrs = Utils.FindMatchingAddresses(user, mlist.members, mlist.digest_members) if addrs: addr = Utils.ObscureEmail(addrs[0]) if mlist.obscure_addresses: addr = Utils.ObscureEmail(addr) url = mlist.GetAbsoluteOptionsURL(addr) link = Link(url, mlist.real_name) return mlist.internal_name(), link | 7f46d3332c15a7ebba80192057a7bef9c50553ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/7f46d3332c15a7ebba80192057a7bef9c50553ca/handle_opts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
702,
7135,
12,
1098,
529,
16,
729,
33,
1355,
4672,
312,
1098,
273,
11542,
682,
18,
6759,
682,
12,
1098,
529,
16,
2176,
33,
20,
13,
11755,
273,
6091,
18,
3125,
9517,
7148,
12,
1355,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
702,
7135,
12,
1098,
529,
16,
729,
33,
1355,
4672,
312,
1098,
273,
11542,
682,
18,
6759,
682,
12,
1098,
529,
16,
2176,
33,
20,
13,
11755,
273,
6091,
18,
3125,
9517,
7148,
12,
1355,
1... |
else: | elif strName.startswith("Reset"): | def menu_item_response(self, w, strName): if strName.startswith("Zoom Out"): self.do_zoom(self.scale.get_value() + 1, True) elif strName.startswith("Zoom In"): self.do_zoom(self.scale.get_value() - 1, True) elif strName.startswith("Center map"): self.do_zoom(self.scale.get_value(), True) else: self.do_zoom(MAP_MAX_ZOOM_LEVEL) | 1e392451bcf2c335985b2603d386c416b9723b00 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5373/1e392451bcf2c335985b2603d386c416b9723b00/maps.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
67,
1726,
67,
2740,
12,
2890,
16,
341,
16,
27840,
4672,
309,
27840,
18,
17514,
1918,
2932,
11497,
2976,
6,
4672,
365,
18,
2896,
67,
14932,
12,
2890,
18,
5864,
18,
588,
67,
1132,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
67,
1726,
67,
2740,
12,
2890,
16,
341,
16,
27840,
4672,
309,
27840,
18,
17514,
1918,
2932,
11497,
2976,
6,
4672,
365,
18,
2896,
67,
14932,
12,
2890,
18,
5864,
18,
588,
67,
1132,
... |
match = nameregex.match(dp.preview_line()) | commandregex = re.compile('\\\\(\S*?):(\S*)(.*)') match = commandregex.match(self.content.preview_line()) | def _extractName(self, dp): """ extract a command with it's name and a description # \cmd:name description # extended description """ match = nameregex.match(dp.preview_line()) if match: dp.get_line() (name, value, desc) = match.groups(1) desc = [ desc.strip() ] desc.extend(self._extractBlock(dp)) return (name, value, desc) return None pass | 58e5719f8c1d5d076eb3b9af15ecc71594baba83 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13121/58e5719f8c1d5d076eb3b9af15ecc71594baba83/generate_doc_from_cmake.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8004,
461,
12,
2890,
16,
9986,
4672,
3536,
2608,
279,
1296,
598,
518,
1807,
508,
471,
279,
2477,
468,
521,
4172,
30,
529,
2477,
468,
6647,
7021,
2477,
3536,
1296,
7584,
273,
283,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8004,
461,
12,
2890,
16,
9986,
4672,
3536,
2608,
279,
1296,
598,
518,
1807,
508,
471,
279,
2477,
468,
521,
4172,
30,
529,
2477,
468,
6647,
7021,
2477,
3536,
1296,
7584,
273,
283,
... |
stop_button = StopButton(self) toolbar_box.toolbar.insert(stop_button, -1) stop_button.show() | stop_button = StopButton(self) toolbar_box.toolbar.insert(stop_button, -1) stop_button.show() | def build_toolbar(self): try: #Use new >= 0.86 toolbar self.max_participants = 1 toolbar_box = ToolbarBox() activity_button = ActivityToolbarButton(self) toolbar_box.toolbar.insert(activity_button, 0) activity_button.show() | ea49d1f52ac432f4f79bb3ce4df0f4000367d140 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7607/ea49d1f52ac432f4f79bb3ce4df0f4000367d140/activity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
18849,
12,
2890,
4672,
775,
30,
468,
3727,
394,
1545,
374,
18,
5292,
12748,
365,
18,
1896,
67,
2680,
27620,
273,
404,
12748,
67,
2147,
273,
13288,
3215,
3514,
1435,
5728,
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,
1361,
67,
18849,
12,
2890,
4672,
775,
30,
468,
3727,
394,
1545,
374,
18,
5292,
12748,
365,
18,
1896,
67,
2680,
27620,
273,
404,
12748,
67,
2147,
273,
13288,
3215,
3514,
1435,
5728,
67,
... |
body = content | body = tools.ustr(content) | def create_record(msg): if hasattr(model_pool, 'message_new'): res_id = model_pool.message_new(cr, uid, msg, context) else: data = { 'name': msg.get('subject'), 'email_from': msg.get('from'), 'email_cc': msg.get('cc'), 'user_id': False, 'description': msg.get('body'), 'state' : 'draft', } data.update(self.get_partner(cr, uid, msg.get('from'), context=context)) res_id = model_pool.create(cr, uid, data, context=context) | 41a15f72a02613fc823e32c36f48444d555f1bb6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/41a15f72a02613fc823e32c36f48444d555f1bb6/mail_gateway.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3366,
12,
3576,
4672,
309,
3859,
12,
2284,
67,
6011,
16,
296,
2150,
67,
2704,
11,
4672,
400,
67,
350,
273,
938,
67,
6011,
18,
2150,
67,
2704,
12,
3353,
16,
4555,
16,
1234,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3366,
12,
3576,
4672,
309,
3859,
12,
2284,
67,
6011,
16,
296,
2150,
67,
2704,
11,
4672,
400,
67,
350,
273,
938,
67,
6011,
18,
2150,
67,
2704,
12,
3353,
16,
4555,
16,
1234,
... |
print 'session is', `session` | def main(self): '''Wrap the database accesses so we can close the database cleanly ''' # determine the uid to use self.opendb('admin') | 181ee96d6baab6fee9d1f8e916dc181211bfcac0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/181ee96d6baab6fee9d1f8e916dc181211bfcac0/cgi_client.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
4672,
9163,
2964,
326,
2063,
2006,
281,
1427,
732,
848,
1746,
326,
2063,
2721,
715,
9163,
468,
4199,
326,
4555,
358,
999,
365,
18,
556,
409,
70,
2668,
3666,
6134,
2,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
12,
2890,
4672,
9163,
2964,
326,
2063,
2006,
281,
1427,
732,
848,
1746,
326,
2063,
2721,
715,
9163,
468,
4199,
326,
4555,
358,
999,
365,
18,
556,
409,
70,
2668,
3666,
6134,
2,
-1... | |
cursor.execute("INSERT INTO session " "(sid,last_visit,authenticated)" " VALUES(%s,%s,1)", (self.req.authname, int(time.time()))) | cursor.execute(""" INSERT INTO session (sid,last_visit,authenticated) VALUES (%s,%s,1) """, (self.req.authname, int(time.time()))) | def update_session_id(db): cursor = db.cursor() cursor.execute("SELECT authenticated FROM session " "WHERE sid=%s OR sid=%s ", (sid, self.req.authname)) authenticated_flags = [row[0] for row in cursor.fetchall()] if len(authenticated_flags) == 2: # There's already an authenticated session for the user, # we simply delete the anonymous session cursor.execute("DELETE FROM session WHERE sid=%s " "AND authenticated=0", (sid,)) cursor.execute("DELETE FROM session_attribute WHERE sid=%s " "AND authenticated=0", (sid,)) elif len(authenticated_flags) == 1: if not authenticated_flags[0]: # Update the anomymous session records so the session ID # becomes the user name, and set the authenticated flag. self.env.log.debug('Promoting anonymous session %s to ' 'authenticated session for user %s', sid, self.req.authname) cursor.execute("UPDATE session SET sid=%s,authenticated=1 " "WHERE sid=%s AND authenticated=0", (self.req.authname, sid)) cursor.execute("UPDATE session_attribute " "SET sid=%s,authenticated=1 WHERE sid=%s", (self.req.authname, sid)) else: # we didn't have an anonymous session for this sid cursor.execute("INSERT INTO session " "(sid,last_visit,authenticated)" " VALUES(%s,%s,1)", (self.req.authname, int(time.time()))) | c9cd2abe472fbff336262b87b60cf1276cdfdeca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/c9cd2abe472fbff336262b87b60cf1276cdfdeca/session.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
3184,
67,
350,
12,
1966,
4672,
3347,
273,
1319,
18,
9216,
1435,
3347,
18,
8837,
2932,
4803,
9370,
4571,
1339,
315,
315,
12299,
7348,
5095,
87,
4869,
7348,
5095,
87,
3104,
261,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
3184,
67,
350,
12,
1966,
4672,
3347,
273,
1319,
18,
9216,
1435,
3347,
18,
8837,
2932,
4803,
9370,
4571,
1339,
315,
315,
12299,
7348,
5095,
87,
4869,
7348,
5095,
87,
3104,
261,
... |
def __init__(self, repository, module, checkoutdir): | def __init__(self, repository, module, checkoutdir, revision): | def __init__(self, repository, module, checkoutdir): self.repository = repository self.config = repository.config self.module = module self.checkoutdir = checkoutdir | 48cb29fd4895b6d2e614f0087fb2d397b0a035f9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4596/48cb29fd4895b6d2e614f0087fb2d397b0a035f9/svn.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
3352,
16,
1605,
16,
13926,
1214,
16,
6350,
4672,
365,
18,
9071,
273,
3352,
365,
18,
1425,
273,
3352,
18,
1425,
365,
18,
2978,
273,
1605,
365,
18,
17300,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12,
2890,
16,
3352,
16,
1605,
16,
13926,
1214,
16,
6350,
4672,
365,
18,
9071,
273,
3352,
365,
18,
1425,
273,
3352,
18,
1425,
365,
18,
2978,
273,
1605,
365,
18,
17300,
... |
kind = "(Kind not found)" | kind = "(kindless)" | def _formatReference(self, ref): """ formats the a reference attribute to be clickable, etcetera """ url = ref.getItemPath() if ref.hasAttributeValue('kind'): kind = ref.kind.getItemName() else: kind = "(Kind not found)" # Originally I was masking the fallback to itemName here just like in # the listview, but that doesn't work for many of the more primitive # repository items, so I stopped doing that. dn = str(ref.getItemDisplayName()) | 39515bce12cb6c4d7eaef4203159c8ba01d8fabd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/39515bce12cb6c4d7eaef4203159c8ba01d8fabd/RepositoryViewer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2139,
2404,
12,
2890,
16,
1278,
4672,
3536,
6449,
326,
279,
2114,
1566,
358,
506,
4682,
429,
16,
5527,
847,
69,
3536,
880,
273,
1278,
18,
588,
1180,
743,
1435,
309,
1278,
18,
5332... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2139,
2404,
12,
2890,
16,
1278,
4672,
3536,
6449,
326,
279,
2114,
1566,
358,
506,
4682,
429,
16,
5527,
847,
69,
3536,
880,
273,
1278,
18,
588,
1180,
743,
1435,
309,
1278,
18,
5332... |
retval = False | def parse_REMADR(self, context, operands): retval = False bank = None aval = None if operands: op = Number(operands[0]) if op.isValid(): aval = op.value else: entry = context.symtab.lookup(operands[0]) if entry: (bank, offset) = context.memmap.pseudoToSegmented(entry.value) if bank and (bank != context.fbank and bank != context.ebank): aval = offset retval = True if aval != None: context.currentRecord.code = [ aval ] context.currentRecord.complete = True return retval | 0c60b51cc3a2e291ba9533bb9ab17f2ef2a0018f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8152/0c60b51cc3a2e291ba9533bb9ab17f2ef2a0018f/directive.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
862,
49,
1880,
54,
12,
2890,
16,
819,
16,
14883,
4672,
11218,
273,
599,
279,
1125,
273,
599,
309,
14883,
30,
1061,
273,
3588,
12,
4063,
5708,
63,
20,
5717,
309,
1061,
18,
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,
1109,
67,
862,
49,
1880,
54,
12,
2890,
16,
819,
16,
14883,
4672,
11218,
273,
599,
279,
1125,
273,
599,
309,
14883,
30,
1061,
273,
3588,
12,
4063,
5708,
63,
20,
5717,
309,
1061,
18,
2... | |
if not package and version is None: | if not package and not version: | def __findPackageOnHost(self, packageName, platform, version, hostUrl, requires = None): appRunner = AppRunnerGlobal.appRunner if not appRunner: # We don't download import files from a host unless we're # running in a packaged environment ourselves. It would # be possible to do this, but a fair bit of work for not # much gain--this is meant to be run in a packaged # environment. return None | 36aaa983243ce8bcd7789787d61af196423084e9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7242/36aaa983243ce8bcd7789787d61af196423084e9/Packager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4720,
2261,
1398,
2594,
12,
2890,
16,
9929,
16,
4072,
16,
1177,
16,
1479,
1489,
16,
4991,
273,
599,
4672,
595,
9709,
273,
4677,
9709,
5160,
18,
2910,
9709,
309,
486,
595,
9709,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
4720,
2261,
1398,
2594,
12,
2890,
16,
9929,
16,
4072,
16,
1177,
16,
1479,
1489,
16,
4991,
273,
599,
4672,
595,
9709,
273,
4677,
9709,
5160,
18,
2910,
9709,
309,
486,
595,
9709,
3... |
clear_cache_all_languages(instance.user.id, instance.group.id) | if instance.group: group_id = group.id clear_cache_all_languages(instance.user.id, group_id) | def clear_authorinfo_cache_postcount(instance, **kwargs): clear_cache_all_languages(instance.user.id, instance.group.id) | 6acdbff31e91bef9100168f11671a38a84bd04b8 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11563/6acdbff31e91bef9100168f11671a38a84bd04b8/sphboard_extras.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
67,
4161,
1376,
67,
2493,
67,
2767,
1883,
12,
1336,
16,
2826,
4333,
4672,
309,
791,
18,
1655,
30,
1041,
67,
350,
273,
1041,
18,
350,
2424,
67,
2493,
67,
454,
67,
14045,
12,
133... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2424,
67,
4161,
1376,
67,
2493,
67,
2767,
1883,
12,
1336,
16,
2826,
4333,
4672,
309,
791,
18,
1655,
30,
1041,
67,
350,
273,
1041,
18,
350,
2424,
67,
2493,
67,
454,
67,
14045,
12,
133... |
color c. * If n > 2, the above construction cannot be exactly covered | color `c`. * If `n > 2`, the above construction cannot be exactly covered | def all_graph_colorings(G,n,count_only=False): """ Computes all n-colorings of the graph G by casting the graph coloring problem into an exact cover problem, and passing this into an implementation of the Dancing Links algorithm described by Knuth (who attributes the idea to Hitotumatu and Noshita). The construction works as follows: (columns) * The first |V| columns correspond to a vertex -- a 1 in this column indicates that that vertex has a color. * After those |V| columns, we add n*|E| columns -- a 1 in these columns indicate that a particular edge is incident to a vertex with a certain color. (rows) * For each vertex, add n rows; one for each color c. Place a 1 in the column corresponding to the vertex, and a 1 in the appropriate column for each edge incident to the vertex, indicating that that edge is incident to the color c. * If n > 2, the above construction cannot be exactly covered since each edge will be incident to only two vertices (and hence two colors) - so we add n*|E| rows, each one containing a 1 for each of the n*|E| columns. These get added to the cover solutions "for free" during the backtracking. Note that this construction results in n*|V| + 2*n*|E| + n*|E| entries in the matrix. The Dancing Links algorithm uses a sparse representation, so if the graph is simple, |E| <= |V|^2 and n <= |V|, this construction runs in O(|V|^3) time. Back-conversion to a coloring solution is a simple scan of the solutions, which will contain |V| + (n-2)*|E| entries, so runs in O(|V|^3) time also. For most graphs, the conversion will be much faster -- for example, a planar graph will be transformed for 4-coloring in linear time since |E| = O(|V|). REFERENCES: http://www-cs-staff.stanford.edu/~uno/papers/dancing-color.ps.gz EXAMPLES: sage: from sage.graphs.graph_coloring import all_graph_colorings sage: G = Graph({0:[1,2,3],1:[2]}) sage: n = 0 sage: for C in all_graph_colorings(G,3): ... parts = [C[k] for k in C] ... for P in parts: ... l = len(P) ... for i in range(l): ... for j in range(i+1,l): ... if G.has_edge(P[i],P[j]): ... raise RuntimeError, "Coloring Failed." ... n+=1 sage: print "G has %s 3-colorings."%n G has 12 3-colorings. TESTS: sage: G = Graph({0:[1,2,3],1:[2]}) sage: for C in all_graph_colorings(G,0): print C sage: for C in all_graph_colorings(G,-1): print C Traceback (most recent call last): ... ValueError: n must be non-negative. """ if n == 0: return if n < 0: raise ValueError, "n must be non-negative." V = G.vertices() E = G.edges() nV=len(V) nE=len(E) ones = [] N = xrange(n) Vd= {} colormap = {} k = 0 for i in range(nV): v = V[i] Vd[v] = i for c in N: ones.append([k, [i]]) colormap[k] = (v,c) k+=1 kk = nV for e in E: for c in N: v0 = n*Vd[e[0]]+c v1 = n*Vd[e[1]]+c ones[v0][1].append(kk+c) ones[v1][1].append(kk+c) kk+=n if n > 2: for i in range(n*nE): ones.append([k+i, [nV+i]]) colors = rainbow(n) for i in range(len(ones)): ones[i] = ones[i][1] try: for a in DLXCPP(ones): if count_only: yield 1 continue coloring = {} for x in a: if colormap.has_key(x): v,c = colormap[x] if coloring.has_key(colors[c]): coloring[colors[c]].append(v) else: coloring[colors[c]] = [v] yield coloring except RuntimeError: raise RuntimeError, "Too much recursion! Graph coloring failed." | 7056b61dfa30c6705aab69c7fdf3017463c8aae2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/7056b61dfa30c6705aab69c7fdf3017463c8aae2/graph_coloring.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
777,
67,
4660,
67,
3266,
899,
12,
43,
16,
82,
16,
1883,
67,
3700,
33,
8381,
4672,
3536,
14169,
281,
777,
290,
17,
3266,
899,
434,
326,
2667,
611,
635,
27660,
326,
2667,
2036,
310,
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,
777,
67,
4660,
67,
3266,
899,
12,
43,
16,
82,
16,
1883,
67,
3700,
33,
8381,
4672,
3536,
14169,
281,
777,
290,
17,
3266,
899,
434,
326,
2667,
611,
635,
27660,
326,
2667,
2036,
310,
61... |
for k,v in optionDict.items(): limitDict[section].append((k,int(v))) | for k, v in optionDict.items(): limitDict[section].append( ( k, int( v ) ) ) | def getExtraConditions(self,site): """ Get extra conditions allowing site throttling """ # Find Site job limits grid,siteName,country = site.split('.') siteSection = '/Resources/Sites/%s/%s' % (grid,site) result = gConfig.getSections('%s/JobLimits' % siteSection) if not result['OK']: return result sections = result['Value'] limitDict = {} resultDict = {} if sections: for section in sections: result = gConfig.getOptionsDict('%s/JobLimits/%s' % (siteSection,section) ) if not result['OK']: return result optionDict = result['Value'] if optionDict: limitDict[section] = [] for k,v in optionDict.items(): limitDict[section].append((k,int(v))) if not limitDict: return S_OK({}) # Check if the site exceeding the given limits fields = limitDict.keys() for field in fields: for key,value in limitDict[field]: result = jobDB.getCounters('Jobs',['Status'],{'Site':site,field:key}) if not result['OK']: return result count = 0 if result['Value']: for countDict,number in result['Value']: if countDict['Status'] == "Running": count = number break if count > value: if not resultDict.has_key(field): resultDict[field] = [] resultDict[field].append(key) | 059c4744ef6766e0575a5cd4d6f09d892a66a7df /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/059c4744ef6766e0575a5cd4d6f09d892a66a7df/MatcherHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24973,
8545,
12,
2890,
16,
4256,
4672,
3536,
968,
2870,
4636,
15632,
2834,
30700,
3536,
468,
4163,
9063,
1719,
8181,
3068,
16,
4256,
461,
16,
9082,
273,
2834,
18,
4939,
2668,
1093,
13,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24973,
8545,
12,
2890,
16,
4256,
4672,
3536,
968,
2870,
4636,
15632,
2834,
30700,
3536,
468,
4163,
9063,
1719,
8181,
3068,
16,
4256,
461,
16,
9082,
273,
2834,
18,
4939,
2668,
1093,
13,
2... |
'location_id': produc_id, | 'location_id': product_id, | def onchange_operation_type(self, cr, uid, ids, type, guarantee_limit): """ On change of operation type it sets source location, destination location and to invoice field. @param product: Changed operation type. @param guarantee_limit: Guarantee limit of current record. @return: Dictionary of values. """ if not type: return {'value': { 'location_id': False, 'location_dest_id': False } } produc_id = self.pool.get('stock.location').search(cr, uid, [('name','=','Production')])[0] | be1a8c1e604749abf7ee3480839b37552209b85e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/be1a8c1e604749abf7ee3480839b37552209b85e/mrp_repair.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
7624,
67,
723,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
618,
16,
18779,
67,
3595,
4672,
3536,
2755,
2549,
434,
1674,
618,
518,
1678,
1084,
2117,
16,
2929,
2117,
471,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
3427,
67,
7624,
67,
723,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
618,
16,
18779,
67,
3595,
4672,
3536,
2755,
2549,
434,
1674,
618,
518,
1678,
1084,
2117,
16,
2929,
2117,
471,
... |
shared.info_msg( _("First create /tmp/tcos_share folder,\nand restart rsync daemon\n/etc/init.d/rsync restart") ) | shared.info_msg( _("TcosMonitor need special configuration for rsync daemon.\n\nPlease read configuration requeriments in:\n/usr/share/doc/tcosmonitor/README.rsync") ) | def menu_event_one(self, action): start1=time() (model, iter) = self.main.tabla.get_selection().get_selected() if iter == None: print_debug( "menu_event_one() not selected thin client !!!" ) return self.main.selected_host=model.get_value(iter,COL_HOST) self.main.selected_ip=model.get_value(iter, COL_IP) if not self.doaction_onthisclient(action, self.main.selected_ip): # show a msg shared.info_msg ( _("Can't exec this action because you are connected at this host!") ) return if action == 0: # refresh terminal # call to read remote info self.main.xmlrpc.newhost(self.main.selected_ip) self.main.xmlrpc.ip=self.main.selected_ip self.main.worker=shared.Workers( self.main,\ target=self.populate_datatxt, args=([self.main.selected_ip]) ).start() if action == 1: # clean datatxtbuffer self.main.datatxt.clean() if action == 2: # Ask for reboot reboot ip=self.main.selected_ip host=self.main.localdata.GetHostname(self.main.selected_ip) msg=_( _("Do you want to reboot %s?" ) %(host) ) if shared.ask_msg ( msg ): timeout=self.main.config.GetVar("actions_timeout") msg=(_("Pc will reboot in %s seconds") %timeout) self.exe_app_in_client("reboot", timeout, msg, users=[self.main.selected_ip]) if action == 3: # Ask for poweroff reboot host=self.main.localdata.GetHostname(self.main.selected_ip) msg=_( _("Do you want to poweroff %s?" ) %(host) ) if shared.ask_msg ( msg ): timeout=self.main.config.GetVar("actions_timeout") msg=(_("Pc will shutdown in %s seconds") %timeout) self.exe_app_in_client("poweroff", timeout, msg, users=[self.main.selected_ip]) if action == 4: # lock screen if not self.main.xmlrpc.lockscreen(): shared.error_msg( _("Can't connect to tcosxmlrpc.\nPlease verify user and password in prefences!") ) return self.change_lockscreen(self.main.selected_ip) if action == 5: # unlock screen if not self.main.xmlrpc.unlockscreen(): shared.error_msg( _("Can't connect to tcosxmlrpc.\nPlease verify user and password in prefences!") ) return self.change_lockscreen(self.main.selected_ip) if action == 6: # start ivs self.main.worker=shared.Workers(self.main, target=self.start_ivs, args=([self.main.selected_ip]) ) self.main.worker.start() if action == 7: # start vnc self.main.worker=shared.Workers(self.main, target=self.start_vnc, args=([self.main.selected_ip]) ) self.main.worker.start() if action == 8: # screenshot !!! self.main.worker=shared.Workers(self.main, target=self.get_screenshot, args=[self.main.selected_ip]) self.main.worker.start() if action == 9: # give a remote xterm throught SSH pass_msg=_("Enter password of remote thin client (if asked for it)") cmd="xterm -e \"echo '%s'; ssh %s@%s || sleep 5\"" %(pass_msg, self.main.config.GetVar("ssh_remote_username"),self.main.selected_ip) print_debug ( "menu_event_one(%d) cmd=%s" %(action, cmd) ) th=self.main.common.exe_cmd( cmd, background=True ) if action == 10: # launch personalize settings if client is TCOS (PXES and LTSP not supported) client_type = self.main.xmlrpc.ReadInfo("get_client") if client_type == "tcos": cmd="gksu \"tcospersonalize --host=%s\"" %(self.main.selected_ip) print_debug ( "menu_event_one(%d) cmd=%s" %(action, cmd) ) th=self.main.common.exe_cmd( cmd, background=True ) else: shared.info_msg( _("%s is not supported to personalize!") %(client_type) ) if action == 11: # reset xorg # Ask for it if not self.main.localdata.IsLogged(self.main.selected_ip): shared.error_msg ( _("Can't logout, user is not logged") ) return user=self.main.localdata.GetUsernameAndHost(self.main.selected_ip) print_debug("menu_event_one() user=%s" %user) msg=_( _("Do you want to logout user \"%s\"?" ) %(user) ) if shared.ask_msg ( msg ): newusernames=[] timeout=self.main.config.GetVar("actions_timeout") msg=_("Session will close in %s seconds") %timeout remote_cmd="/usr/lib/tcos/session-cmd-send LOGOUT %s %s" %(timeout, msg) if user.find(":") != -1: # we have a standalone user... usern, ip = user.split(":") self.main.xmlrpc.newhost(ip) self.main.xmlrpc.DBus("exec", remote_cmd ) else: newusernames.append(user) result = self.main.dbus_action.do_exec(newusernames ,remote_cmd ) if not result: shared.error_msg ( _("Error while exec remote app:\nReason:%s") %( self.main.dbus_action.get_error_msg() ) ) if action == 12: # restart xorg with new settings # thin client must download again XXX.XXX.XXX.XXX.conf and rebuild xorg.conf client_type = self.main.xmlrpc.ReadInfo("get_client") if client_type == "tcos": msg=_( "Restart X session of %s with new config?" ) %(self.main.selected_ip) if shared.ask_msg ( msg ): # see xmlrpc/xorg.h, rebuild will download and sed xorg.conf.tpl self.main.xmlrpc.tc.tcos.xorg("rebuild", "--restartxorg", \ self.main.xmlrpc.username, \ self.main.xmlrpc.password ) self.refresh_client_info(self.main.selected_ip) else: shared.info_msg( _("%s is not supported to restart Xorg!") %(client_type) ) if action == 13: # exec app if not self.main.localdata.IsLogged(self.main.selected_ip): shared.error_msg ( _("Can't exec application, user is not logged") ) return self.askfor(mode="exec", users=[self.main.localdata.GetUsernameAndHost(self.main.selected_ip)]) if action == 14: # send message if not self.main.localdata.IsLogged(self.main.selected_ip): shared.error_msg ( _("Can't send message, user is not logged") ) return self.askfor(mode="mess", users=[self.main.localdata.GetUsernameAndHost(self.main.selected_ip)] ) if action == 15: print_debug ("menu_event_one() show running apps" ) self.get_user_processes(self.main.selected_ip) if action == 16: # action sent by vidal_joshur at gva dot es # start video broadcast mode # Stream to single client unicast eth=self.main.config.GetVar("network_interface") users=[self.main.localdata.GetUsernameAndHost(self.main.selected_ip)] if not self.main.localdata.IsLogged(self.main.selected_ip): shared.error_msg ( _("Can't send video broadcast, user is not logged") ) return str_scapes=[" ", "(", ")", "*", "!", "?", "\"", "`", "[", "]", "{", "}", ";", ":", ",", "=", "$"] lock="disable" volume="85" client_type = self.main.xmlrpc.ReadInfo("get_client") if client_type == "tcos": ip_unicast="239.255.255.0" remote_cmd="vlc udp://@%s:1234 --brightness=2 --no-x11-shm --no-xvideo-shm --disable-screensaver --volume=300" %(ip_unicast) else: ip_unicast=self.main.selected_ip remote_cmd="vlc udp://@:1234 --brightness=2 --no-x11-shm --no-xvideo-shm --disable-screensaver --volume=300" dialog = gtk.FileChooserDialog(_("Select audio/video file.."), None, gtk.FILE_CHOOSER_ACTION_OPEN, (_("Play DVD"), 1, _("Play SVCD/VCD"), 2, _("Play AudioCD"), 3, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK)) dialog.set_default_response(gtk.RESPONSE_OK) self.folder = self._folder = os.environ['HOME'] dialog.set_current_folder(self.folder) filter = gtk.FileFilter() filter.set_name("Media Files ( *.avi, *.mpg, *.mpeg, *.mp3, *.wav, etc.. )") file_types=["*.avi", "*.mpg", "*.mpeg", "*.ogg", "*.ogm", "*.asf", "*.divx", "*.wmv", "*.vob", "*.m2v", "*.m4v", "*.mp2", "*.mp4", "*.ac3", "*.ogg", "*.mp1", "*.mp2", "*.mp3", "*.wav", "*.wma"] for elem in file_types: filter.add_pattern( elem ) dialog.add_filter(filter) filter = gtk.FileFilter() filter.set_name("All Files") filter.add_pattern("*.*") dialog.add_filter(filter) response = dialog.run() if response == gtk.RESPONSE_OK or response == 1 or response == 2 or response == 3: filename=dialog.get_filename() dialog.destroy() if filename.find(" ") != -1: msg=_("Not allowed white spaces in %s filename.\nPlease rename it." %os.path.basename(filename) ) shared.info_msg( msg ) return for scape in str_scapes: filename=filename.replace("%s" %scape, "\%s" %scape) if response == gtk.RESPONSE_OK: p=subprocess.Popen(["vlc", "file://%s" %filename, "--sout=#duplicate{dst=display{delay=1000},dst=\"transcode{vcodec=mp4v,acodec=%s,vb=800,ab=112,channels=2,soverlay}:standard{access=udp,mux=ts,dst=%s:1234}\"}" %(self.main.config.GetVar("vlc_audio_codec"), ip_unicast), "--miface=%s" %eth, "--ttl=12", "--brightness=2", "--no-x11-shm", "--no-xvideo-shm", "--disable-screensaver" ], shell=False) elif response == 1: p=subprocess.Popen(["vlc", "dvd://", "--sout=#duplicate{dst=display{delay=1000},dst=\"transcode{vcodec=mp4v,acodec=%s,vb=800,ab=112,channels=2,soverlay}:standard{access=udp,mux=ts,dst=%s:1234}\"}" %(self.main.config.GetVar("vlc_audio_codec"), ip_unicast), "--miface=%s" %eth, "--ttl=12", "--loop", "--brightness=2", "--no-x11-shm", "--no-xvideo-shm", "--disable-screensaver"], shell=False) elif response == 2: p=subprocess.Popen(["vlc", "vcd://", "--sout=#duplicate{dst=display{delay=1000},dst=\"transcode{vcodec=mp4v,acodec=%s,vb=800,ab=112,channels=2,soverlay}:standard{access=udp,mux=ts,dst=%s:1234}\"}" %(self.main.config.GetVar("vlc_audio_codec"), ip_unicast), "--miface=%s" %eth, "--ttl=12", "--brightness=2", "--no-x11-shm", "--no-xvideo-shm", "--disable-screensaver"], shell=False) elif response == 3: p=subprocess.Popen(["vlc", "cdda://", "--sout=#duplicate{dst=display,dst=\"transcode{vcodec=mp4v,vb=200,acodec=%s,ab=112,channels=2}:standard{access=udp,mux=ts,dst=%s:1234}\"}" %(self.main.config.GetVar("vlc_audio_codec"), ip_unicast), "--miface=%s" %eth, "--ttl=12", "--no-x11-shm", "--no-xvideo-shm", "--disable-screensaver"], shell=False) # exec this app on client self.main.write_into_statusbar( _("Waiting for start video transmission...") ) msg=_("First select the DVD chapter or play movie\nthen press enter to send clients..." ) shared.info_msg( msg ) # check if vlc is running or fail like check ping in demo mode running = p.poll() is None if not running: self.main.write_into_statusbar( _("Error while exec app")) return msg=_( "Lock keyboard and mouse on client?" ) if shared.ask_msg ( msg ): lock="enable" newusernames=[] | c6ac1f6bfa3b4985db0f6ae0f7ad14c0c38479f5 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13520/c6ac1f6bfa3b4985db0f6ae0f7ad14c0c38479f5/TcosActions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3824,
67,
2575,
67,
476,
12,
2890,
16,
1301,
4672,
787,
21,
33,
957,
1435,
261,
2284,
16,
1400,
13,
273,
365,
18,
5254,
18,
7032,
11821,
18,
588,
67,
10705,
7675,
588,
67,
8109,
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,
3824,
67,
2575,
67,
476,
12,
2890,
16,
1301,
4672,
787,
21,
33,
957,
1435,
261,
2284,
16,
1400,
13,
273,
365,
18,
5254,
18,
7032,
11821,
18,
588,
67,
10705,
7675,
588,
67,
8109,
1435... |
h = g.reduce(self.__singular_groebner_basis) | try: h = g.reduce(self.__singular_groebner_basis) except TypeError: return f | def reduce(self, f): """ Reduce an element modulo a standard basis for this ideal. This returns 0 if and only if the element is in this ideal. EXAMPLES: sage: R.<x,y> = PolynomialRing(QQ, 2) sage: I = (x^3 + y, y)*R sage: I.reduce(y) 0 sage: I.reduce(x^3) 0 sage: I.reduce(x - y) x | afc5175770e7adc669ccbed69a710aaa101df11d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/afc5175770e7adc669ccbed69a710aaa101df11d/multi_polynomial_ideal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5459,
12,
2890,
16,
284,
4672,
3536,
24614,
392,
930,
26109,
279,
4529,
10853,
364,
333,
23349,
18,
1220,
1135,
374,
309,
471,
1338,
309,
326,
930,
353,
316,
333,
23349,
18,
225,
5675,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5459,
12,
2890,
16,
284,
4672,
3536,
24614,
392,
930,
26109,
279,
4529,
10853,
364,
333,
23349,
18,
1220,
1135,
374,
309,
471,
1338,
309,
326,
930,
353,
316,
333,
23349,
18,
225,
5675,
... |
timeout=1): | timeout=5): | def test_map_timeout(self): results = [] timeout_call = MapCall() try: try: for i in self.executor.map(timeout_call, [False, False, True], timeout=1): results.append(i) except futures.TimeoutError: pass else: self.fail('expected TimeoutError') finally: timeout_call.close() | 5d23912669a4c6badda722161d699e883954f2b7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/5d23912669a4c6badda722161d699e883954f2b7/test_concurrent_futures.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
1458,
67,
4538,
12,
2890,
4672,
1686,
273,
5378,
2021,
67,
1991,
273,
1635,
1477,
1435,
775,
30,
775,
30,
364,
277,
316,
365,
18,
21097,
18,
1458,
12,
4538,
67,
1991,
16,
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,
1842,
67,
1458,
67,
4538,
12,
2890,
4672,
1686,
273,
5378,
2021,
67,
1991,
273,
1635,
1477,
1435,
775,
30,
775,
30,
364,
277,
316,
365,
18,
21097,
18,
1458,
12,
4538,
67,
1991,
16,
3... |
log(query, netsvc.LOG_WARNING) log("SQL queries cannot contain %d or %f anymore. Use only %s", netsvc.LOG_WARNING) | self.__logger.warn(query) self.__logger.warn("SQL queries cannot contain %d or %f anymore. Use only %s") | def execute_prepared(self, name, query, params=None, debug=False, datatypes=None): """ Execute and return one query, through a prepared statement. The name argument is required, and should be unique accross all code. The query will be PREPARE'd and given this name. Then, executed. Subsequent calls to the same /code/ will just re-use the prepared statement under this name. datatypes, if specified, will strictly define the parameter types to the prepared statement. """ assert ( (not datatypes) or len(datatypes) == len(params or [])) assert (name) if not name in self.__prepared: if '%d' in query or '%f' in query: log(query, netsvc.LOG_WARNING) log("SQL queries cannot contain %d or %f anymore. Use only %s", netsvc.LOG_WARNING) if params: query = query.replace('%d', '%s').replace('%f', '%s') args = '' if params and len(params): query = query % tuple(map(lambda x: '$%d' % (x+1) , range(len(params)))) if datatypes: dtt = datatypes else: dtt = [ 'UNKNOWN' for x in range(len(params)) ] args = '(' + ', '.join(dtt) + ')' qry = 'PREPARE ' + name + args + ' AS ' + query + ';' self.execute(qry, debug=debug) self.__prepared.append(name) args = '' if params and len(params): args = [ '%s' for x in range(len(params)) ] args = '(' + ', '.join(args) + ')' return self.execute('EXECUTE ' +name + ' '+ args + ';', params, debug=debug) | 6b17a7b33cd5232ba593e744762468d7305f132c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/6b17a7b33cd5232ba593e744762468d7305f132c/sql_db.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
9366,
72,
12,
2890,
16,
508,
16,
843,
16,
859,
33,
7036,
16,
1198,
33,
8381,
16,
14760,
33,
7036,
4672,
3536,
7903,
471,
327,
1245,
843,
16,
3059,
279,
8208,
3021,
18,
1021... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1836,
67,
9366,
72,
12,
2890,
16,
508,
16,
843,
16,
859,
33,
7036,
16,
1198,
33,
8381,
16,
14760,
33,
7036,
4672,
3536,
7903,
471,
327,
1245,
843,
16,
3059,
279,
8208,
3021,
18,
1021... |
t4t_r = self.t4t_policy.apply(conn, self.download_state, self.storage) self.t4t_stop = t4t_r if self.t4t_stop and self.g2g_stop: | self.t4t_eligible = self.t4t_policy.apply(conn, self.download_state, self.storage) if DEBUG: print >>sys.stderr,"DenySeeding to t4t peer: ",self.download_state.get_download().get_dest_files() if not (self.t4t_eligible or self.g2g_eligible): if DEBUG: print >>sys.stderr,"Stop seedings: ",self.download_state.get_download().get_dest_files() | def is_conn_eligible(self, conn): if conn.use_g2g: g2g_r = self.g2g_policy.apply(conn, self.download_state, self.storage) self.g2g_stop = g2g_r # If seeding stop both to g2g and t4t # then stop seeding if self.t4t_stop and self.g2g_stop: self.download_state.get_download().stop() if DEBUG: print >>sys.stderr,"Stop seedings: ",self.download_state.get_download().get_dest_files() return g2g_r else: t4t_r = self.t4t_policy.apply(conn, self.download_state, self.storage) self.t4t_stop = t4t_r if self.t4t_stop and self.g2g_stop: self.download_state.get_download().stop() if DEBUG: print >>sys.stderr,"Stop seedings: ",self.download_state.get_download().get_dest_files() return t4t_r | 74c608cb17501b92364ed3a8edec943a31bb3b66 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9686/74c608cb17501b92364ed3a8edec943a31bb3b66/SeedingManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
4646,
67,
292,
16057,
12,
2890,
16,
1487,
4672,
309,
1487,
18,
1202,
67,
75,
22,
75,
30,
314,
22,
75,
67,
86,
273,
365,
18,
75,
22,
75,
67,
5086,
18,
9010,
12,
4646,
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,
353,
67,
4646,
67,
292,
16057,
12,
2890,
16,
1487,
4672,
309,
1487,
18,
1202,
67,
75,
22,
75,
30,
314,
22,
75,
67,
86,
273,
365,
18,
75,
22,
75,
67,
5086,
18,
9010,
12,
4646,
16,... |
pkg_name, affected, binaries, undo = self.doop_source(pkg) | pkg_name, suite, affected, undo = self.doop_source(pkg) | def iter_packages(self, packages, output): extra = [] nuninst_comp = self.get_nuninst() | 0ef270283d494acfb65d58fb8123811e47c21a74 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2784/0ef270283d494acfb65d58fb8123811e47c21a74/britney.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
10308,
12,
2890,
16,
5907,
16,
876,
4672,
2870,
273,
5378,
290,
318,
8591,
67,
2919,
273,
365,
18,
588,
67,
82,
318,
8591,
1435,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1400,
67,
10308,
12,
2890,
16,
5907,
16,
876,
4672,
2870,
273,
5378,
290,
318,
8591,
67,
2919,
273,
365,
18,
588,
67,
82,
318,
8591,
1435,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def mount_sudo(self, child): | def mount_sudo(self, child, sudo_passwd=None): | def mount_sudo(self, child): """packed into a function because we maybe need to call it again and again...""" res = child.expect([response.ENTER_SUDO_PASSWORD, response.SUDO_WRONG_PASSWORD, response.VOLUME_MOUNTED, pexpect.EOF, response.ALREADY_MAPPED], timeout=200) if res == 0: child.sendline(sudo_passwd) return self.mount_sudo(child) elif res == 1: self._error = tcerr.missing_sudo child.kill(9) return self._error elif res == 2 or res == 3: self._status = tcerr.mounted return self._status elif res == 4: self._status = tcerr.allready_mounted return self._status else: print "DEBUGGING INFORMATION" print print child child.kill(9) return tcerr.unknown_error | 60b3b9a27c4ff72b2dcd101c13a745afaffb647f /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3000/60b3b9a27c4ff72b2dcd101c13a745afaffb647f/truecrypt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5344,
67,
20566,
12,
2890,
16,
1151,
16,
14669,
67,
24002,
33,
7036,
4672,
3536,
2920,
329,
1368,
279,
445,
2724,
732,
6944,
1608,
358,
745,
518,
3382,
471,
3382,
7070,
3660,
400,
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,
5344,
67,
20566,
12,
2890,
16,
1151,
16,
14669,
67,
24002,
33,
7036,
4672,
3536,
2920,
329,
1368,
279,
445,
2724,
732,
6944,
1608,
358,
745,
518,
3382,
471,
3382,
7070,
3660,
400,
273,
... |
labels -- if False, each edge is a tuple (u,v) of vertices. | labels -- (bool; default: True) if False, each edge is a tuple (u,v) of vertices. sort -- (bool; default: True) if True, ensure that the list of edges is sorted. OUTPUT: A list of tuples. It is safe to change the returned list. | def edges(self, labels=True): """ Return a list of edges. Each edge is a triple (u,v,l) where the edge is from u to v, with label l. | a93c6f591f8298acfe9c0ed6cb3f79020ee76927 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/a93c6f591f8298acfe9c0ed6cb3f79020ee76927/graph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5231,
12,
2890,
16,
3249,
33,
5510,
4672,
3536,
2000,
279,
666,
434,
5231,
18,
8315,
3591,
353,
279,
14543,
261,
89,
16,
90,
16,
80,
13,
1625,
326,
3591,
353,
628,
582,
358,
331,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5231,
12,
2890,
16,
3249,
33,
5510,
4672,
3536,
2000,
279,
666,
434,
5231,
18,
8315,
3591,
353,
279,
14543,
261,
89,
16,
90,
16,
80,
13,
1625,
326,
3591,
353,
628,
582,
358,
331,
16,... |
gLogger.error("%s.processTransformation: Failed to obtain input data." % AGENT_NAME, res['Message']) | gLogger.error( "%s.processTransformation: Failed to obtain input data." % AGENT_NAME, res['Message'] ) | def processTransformation(self,transDict): transID = transDict['TransformationID'] # First get the LFNs associated to the transformation res = self.transDB.getTransformationFiles(condDict={'TransformationID':transID,'Status':'Unused'}) if not res['OK']: gLogger.error("%s.processTransformation: Failed to obtain input data." % AGENT_NAME, res['Message']) return res transFiles = res['Value'] lfns = res['LFNs'] if not lfns: gLogger.info("%s.processTransformation: No 'Unused' files found for transformation." % AGENT_NAME) if transDict['Status'] == 'Flush': res = self.transDB.setTransformationParameter(transID,'Status','Active') if not res['OK']: gLogger.error("%s.execute: Failed to update transformation status to 'Active'." % AGENT_NAME, res['Message']) else: gLogger.info("%s.execute: Updated transformation status to 'Active'." % AGENT_NAME) return S_OK() | 5b98b3b45ce744b0fa8f66e9d9812d0b7910a0ab /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/5b98b3b45ce744b0fa8f66e9d9812d0b7910a0ab/TransformationAgent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
15292,
12,
2890,
16,
2338,
5014,
4672,
906,
734,
273,
906,
5014,
3292,
15292,
734,
3546,
468,
5783,
336,
326,
18803,
10386,
3627,
358,
326,
8620,
400,
273,
365,
18,
2338,
2290,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
15292,
12,
2890,
16,
2338,
5014,
4672,
906,
734,
273,
906,
5014,
3292,
15292,
734,
3546,
468,
5783,
336,
326,
18803,
10386,
3627,
358,
326,
8620,
400,
273,
365,
18,
2338,
2290,
18,... |
/* rows = rows + 1; */ | rows = rows + 1; | def javascript(): s = async_lib() s+= r""" | 501a41298cad0b2bc100e846c504fcee7864d80c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/501a41298cad0b2bc100e846c504fcee7864d80c/js.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11341,
13332,
272,
273,
4326,
67,
2941,
1435,
272,
15,
33,
436,
8395,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
11341,
13332,
272,
273,
4326,
67,
2941,
1435,
272,
15,
33,
436,
8395,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
import codecs def check_fsencoding(fs_encoding, expected=None): self.assertIsNotNone(fs_encoding) if sys.platform == 'darwin': self.assertEqual(fs_encoding, 'utf-8') codecs.lookup(fs_encoding) if expected: self.assertEqual(fs_encoding, expected) | def test_getfilesystemencoding(self): import codecs | ecaa6fcd04611a787eb2975901743eabe75619d9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/ecaa6fcd04611a787eb2975901743eabe75619d9/test_sys.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
17846,
5999,
12,
2890,
4672,
1930,
17437,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
588,
17846,
5999,
12,
2890,
4672,
1930,
17437,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
child.set_due_date(fulldate) | child.set_due_date(fulldate,fromparent=True) | def set_due_date(self,fulldate) : #We retrieve the most urgent due date from parent parent_date = None for par in self.get_parents() : pardate_str = self.req.get_task(par).get_due_date() if pardate_str : pardate = strtodate(pardate_str) if not parent_date or pardate < strtodate(parent_date) : parent_date = pardate_str if parent_date : if not fulldate or strtodate(parent_date) < strtodate(fulldate) : fulldate = parent_date #Now we set the duedate if fulldate : self.due_date = strtodate(fulldate) #We set the due date for children only #if their due date is "larger" (or none) for child in self.get_subtasks() : actual_date = child.get_due_date() if actual_date : rfulldate = strtodate(fulldate) ractual = strtodate(actual_date) if rfulldate < ractual : child.set_due_date(fulldate) else : child.set_due_date(fulldate) else : self.due_date = None self.sync() | d954d1d15642d25bddcbba2f07695109e37add3d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7036/d954d1d15642d25bddcbba2f07695109e37add3d/task.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
24334,
67,
712,
12,
2890,
16,
2854,
712,
13,
294,
468,
3218,
4614,
326,
4486,
8896,
75,
319,
6541,
1509,
628,
982,
982,
67,
712,
273,
599,
364,
779,
316,
365,
18,
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,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
24334,
67,
712,
12,
2890,
16,
2854,
712,
13,
294,
468,
3218,
4614,
326,
4486,
8896,
75,
319,
6541,
1509,
628,
982,
982,
67,
712,
273,
599,
364,
779,
316,
365,
18,
588,
67,
... |
tc_session.save_or_update(circ) | tc_session.add(circ) | def circ_status_event(self, c): if self.track_parent and c.cird_id not in self.parent_handler.circuits: return # Ignore circuits that aren't ours # TODO: Hrmm, consider making this sane in TorCtl. if c.reason: lreason = c.reason else: lreason = "NONE" if c.remote_reason: rreason = c.remote_reason else: rreason = "NONE" reason = c.event_name+":"+c.status+":"+lreason+":"+rreason | c8ad6cda0735bca71a66e2ae8dc82c8034ffc7ce /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3224/c8ad6cda0735bca71a66e2ae8dc82c8034ffc7ce/SQLSupport.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
18956,
67,
2327,
67,
2575,
12,
2890,
16,
276,
4672,
309,
365,
18,
4101,
67,
2938,
471,
276,
18,
71,
6909,
67,
350,
486,
316,
365,
18,
2938,
67,
4176,
18,
11614,
30091,
30,
327,
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,
18956,
67,
2327,
67,
2575,
12,
2890,
16,
276,
4672,
309,
365,
18,
4101,
67,
2938,
471,
276,
18,
71,
6909,
67,
350,
486,
316,
365,
18,
2938,
67,
4176,
18,
11614,
30091,
30,
327,
468,
... |
axis = len(x.type.broadcastable) | axis = len(x.type.broadcastable)-1 | def max(x, axis=None): """ Return maximum elements obtained by iterating over given axis Default axis is the last one. :note: we return an error as numpy when we reduce a dim with a shape of 0 :note2: see MaxAndArgmax note for a difference between numpy and theano when axis==None """ if isinstance(axis,int) or axis is None or (isinstance(axis,(list,tuple)) and all([isinstance(i,int) for i in axis])): if axis is None: axis = len(x.type.broadcastable) return CAReduce(scal.maximum,axis)(x) #TODO: do CAReduce need axis to be constant? try: const = get_constant_value(axis) return CAReduce(scal.maximum,list(const))(x) except: return max_and_argmax(x,axis)[0] | 64d4ef85e8f1a64963740cb0049ad6c20324cdfa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/64d4ef85e8f1a64963740cb0049ad6c20324cdfa/basic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
12,
92,
16,
2654,
33,
7036,
4672,
3536,
2000,
4207,
2186,
12700,
635,
13099,
1879,
864,
2654,
225,
2989,
2654,
353,
326,
1142,
1245,
18,
225,
294,
7652,
30,
732,
327,
392,
555,
48... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
12,
92,
16,
2654,
33,
7036,
4672,
3536,
2000,
4207,
2186,
12700,
635,
13099,
1879,
864,
2654,
225,
2989,
2654,
353,
326,
1142,
1245,
18,
225,
294,
7652,
30,
732,
327,
392,
555,
48... |
if str(v) == '[Errno 32] Broken pipe': | if str( v ) == '[Errno 32] Broken pipe': | def __executePythonFunction( self, function, writePipe, *stArgs, **stKeyArgs ): try: os.write( writePipe, DEncode.encode( S_OK( function( *stArgs, **stKeyArgs ) ) ) ) except OSError, v: if str(v) == '[Errno 32] Broken pipe': # the parent has died pass except Exception, v: self.log.exception( 'Exception while executing', function.__name__ ) os.write( writePipe, DEncode.encode( S_ERROR( str( v ) ) ) ) #HACK: Allow some time to flush logs time.sleep(1) try: os.close( writePipe ) finally: os._exit(0) | 070804aede19d40a2cbeb29a965a98608f0084b0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/070804aede19d40a2cbeb29a965a98608f0084b0/Subprocess.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8837,
15774,
2083,
12,
365,
16,
445,
16,
1045,
11546,
16,
380,
334,
2615,
16,
2826,
334,
653,
2615,
262,
30,
775,
30,
1140,
18,
2626,
12,
1045,
11546,
16,
463,
5509,
18,
3015,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8837,
15774,
2083,
12,
365,
16,
445,
16,
1045,
11546,
16,
380,
334,
2615,
16,
2826,
334,
653,
2615,
262,
30,
775,
30,
1140,
18,
2626,
12,
1045,
11546,
16,
463,
5509,
18,
3015,
... |
invalidate=self._cache.invalidate for oid in oids: invalidate(oid, src) | vlen = pack(">H", len(src)) for oid in oids: self._tfile.write("i%s%s%s" % (oid, vlen, src)) | def abortVersion(self, src, transaction): if transaction is not self._transaction: raise POSException.StorageTransactionError(self, transaction) self._lock_acquire() try: oids=self._call('abortVersion', src, self._serial) invalidate=self._cache.invalidate for oid in oids: invalidate(oid, src) return oids finally: self._lock_release() | fd48e2d583d08a1d52eb7b982c73ea0612be3009 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10048/fd48e2d583d08a1d52eb7b982c73ea0612be3009/ClientStorage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6263,
1444,
12,
2890,
16,
1705,
16,
2492,
4672,
309,
2492,
353,
486,
365,
6315,
7958,
30,
1002,
12511,
503,
18,
3245,
3342,
668,
12,
2890,
16,
2492,
13,
365,
6315,
739,
67,
1077,
1039,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6263,
1444,
12,
2890,
16,
1705,
16,
2492,
4672,
309,
2492,
353,
486,
365,
6315,
7958,
30,
1002,
12511,
503,
18,
3245,
3342,
668,
12,
2890,
16,
2492,
13,
365,
6315,
739,
67,
1077,
1039,... |
if fp is not None: fp.close() if tempname is not None: os.unlink(tempname) | fp.close() os.unlink(tempname) | def check_heads(): heads = map(hex, self.repo.heads()) return their_heads == [hex('force')] or their_heads == heads | 68c6f6bcb0f2b3056fdecfe6f77208bce48cd71e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/68c6f6bcb0f2b3056fdecfe6f77208bce48cd71e/sshserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
20263,
13332,
22742,
273,
852,
12,
7118,
16,
365,
18,
7422,
18,
20263,
10756,
327,
3675,
67,
20263,
422,
306,
7118,
2668,
5734,
6134,
65,
578,
3675,
67,
20263,
422,
22742,
2,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
20263,
13332,
22742,
273,
852,
12,
7118,
16,
365,
18,
7422,
18,
20263,
10756,
327,
3675,
67,
20263,
422,
306,
7118,
2668,
5734,
6134,
65,
578,
3675,
67,
20263,
422,
22742,
2,
... |
self.set_cdata_mode() | self.set_cdata_mode(tag) | def parse_starttag(self, i): self.__starttag_text = None endpos = self.check_for_whole_start_tag(i) if endpos < 0: return endpos rawdata = self.rawdata self.__starttag_text = rawdata[i:endpos] | 1c2de949e72b4ab0392a7aacbc8554a098df7be3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/1c2de949e72b4ab0392a7aacbc8554a098df7be3/HTMLParser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
1937,
2692,
12,
2890,
16,
277,
4672,
365,
16186,
1937,
2692,
67,
955,
273,
599,
679,
917,
273,
365,
18,
1893,
67,
1884,
67,
3350,
790,
67,
1937,
67,
2692,
12,
77,
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,
1109,
67,
1937,
2692,
12,
2890,
16,
277,
4672,
365,
16186,
1937,
2692,
67,
955,
273,
599,
679,
917,
273,
365,
18,
1893,
67,
1884,
67,
3350,
790,
67,
1937,
67,
2692,
12,
77,
13,
309,
... |
if pos > len(self._fragments): msg = "Can not append %s in position %d, fragments length = %d" raise RuntimeError(msg % (text, pos, len(self._fragments))) self._fragments.insert(pos, text) | self._fragments.append((pos, text)) | def add_text_fragment(self, text, pos=0): if pos > len(self._fragments): msg = "Can not append %s in position %d, fragments length = %d" raise RuntimeError(msg % (text, pos, len(self._fragments))) | 4992fd92813883201e3fd4e88751d524f3544b6f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12036/4992fd92813883201e3fd4e88751d524f3544b6f/sms.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
955,
67,
11956,
12,
2890,
16,
977,
16,
949,
33,
20,
4672,
309,
949,
405,
562,
12,
2890,
6315,
29528,
4672,
1234,
273,
315,
2568,
486,
714,
738,
87,
316,
1754,
738,
72,
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,
527,
67,
955,
67,
11956,
12,
2890,
16,
977,
16,
949,
33,
20,
4672,
309,
949,
405,
562,
12,
2890,
6315,
29528,
4672,
1234,
273,
315,
2568,
486,
714,
738,
87,
316,
1754,
738,
72,
16,
... |
MAKE NOTE IN DOCS THAT TO GET AN AUTO-INCREMENTING PRIMARY KEY, YOU MUST USE THE FULL WORD *INTEGER* INSTEAD OF *INT*. | Creates a new table in the database. To create a table, a column structure must be specified. The form for this is a Python dict, for example: {'col1': {'sql':'INTEGER', 'index':False, 'primary_key':False}, ...} | def create_table(self, table_name, table_skeleton): """ MAKE NOTE IN DOCS THAT TO GET AN AUTO-INCREMENTING PRIMARY KEY, YOU MUST USE THE FULL WORD *INTEGER* INSTEAD OF *INT*. INPUT: table_name -- deurrrrrrrrrrr table_skeleton -- a double-indexed dictionary outer key - column name inner key - one of the following: primary_key - boolean, whether column has been set as primary key index - boolean, whether column has been set as index sql - one of 'STRING', 'BOOLEAN', 'INTEGER', 'REAL', or other user defined type | 5ddf79d83938a9c0191ec3af2f60e264a74ecef9 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/5ddf79d83938a9c0191ec3af2f60e264a74ecef9/database.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2121,
12,
2890,
16,
1014,
67,
529,
16,
1014,
67,
7771,
12143,
4672,
3536,
10210,
279,
394,
1014,
316,
326,
2063,
18,
225,
2974,
752,
279,
1014,
16,
279,
1057,
3695,
1297,
506,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
2121,
12,
2890,
16,
1014,
67,
529,
16,
1014,
67,
7771,
12143,
4672,
3536,
10210,
279,
394,
1014,
316,
326,
2063,
18,
225,
2974,
752,
279,
1014,
16,
279,
1057,
3695,
1297,
506,... |
return tools.version_string + _(''' Tiny ERP is an ERP+CRM program for small and medium businesses. | return _(''' OpenERP is an ERP+CRM program for small and medium businesses. | def about(self): return tools.version_string + _(''' | 7ffb0405893c2803f19a86188f8765136d81c5cc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/7ffb0405893c2803f19a86188f8765136d81c5cc/web_services.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2973,
12,
2890,
4672,
327,
8513,
18,
1589,
67,
1080,
397,
389,
2668,
6309,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2973,
12,
2890,
4672,
327,
8513,
18,
1589,
67,
1080,
397,
389,
2668,
6309,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.T = self.T0*exp(-self.c * self.k**(self.quench/self.dims)) | self.T = self.T0*exp(-self.c * self.k**(self.quench)) | def update_temp(self): self.T = self.T0*exp(-self.c * self.k**(self.quench/self.dims)) self.k += 1 return | 5d83f70d8d9b65f40e4932969c9d8113c8f4f8cd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/5d83f70d8d9b65f40e4932969c9d8113c8f4f8cd/anneal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
5814,
12,
2890,
4672,
365,
18,
56,
273,
365,
18,
56,
20,
14,
2749,
19236,
2890,
18,
71,
380,
365,
18,
79,
636,
12,
2890,
18,
372,
7382,
3719,
365,
18,
79,
1011,
404,
327,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1089,
67,
5814,
12,
2890,
4672,
365,
18,
56,
273,
365,
18,
56,
20,
14,
2749,
19236,
2890,
18,
71,
380,
365,
18,
79,
636,
12,
2890,
18,
372,
7382,
3719,
365,
18,
79,
1011,
404,
327,... |
print "Running model with %s=%s"%(fixture["name"], str(ps)) | def param_vs_spectrum(fixture, nefolds=5): """Run tests for a particular parameter, return mass used and spectrum after horizon exit""" results = None for ps in fixture["values"]: sim = c.FOCanonicalTwoStage(solver="rkdriver_withks", ystart=fixture["ystart"], k=fixture["pivotk"], potential_func=fixture["pot"], pot_params={fixture["name"]: ps}, tend=83, quiet=True) print "Running model with %s=%s"%(fixture["name"], str(ps)) sim.run(saveresults=False) Pr = sim.findspectrum() tres = sim.findHorizoncrossings()[:,0] + nefolds/sim.tstep_wanted Pres = Pr[tres.astype(int)].diagonal()[0] if results is not None: results = N.vstack((results, N.array([ps, Pres]))) else: results = N.array([ms, Pres]) del sim return results | edecb74a66cdbec50fac9b5958d5055581d6a1ec /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7283/edecb74a66cdbec50fac9b5958d5055581d6a1ec/findparams.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
579,
67,
6904,
67,
87,
13324,
12,
904,
10970,
16,
1073,
16007,
87,
33,
25,
4672,
3536,
1997,
7434,
364,
279,
6826,
1569,
16,
327,
8039,
1399,
471,
17970,
1839,
366,
20648,
2427,
8395,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
579,
67,
6904,
67,
87,
13324,
12,
904,
10970,
16,
1073,
16007,
87,
33,
25,
4672,
3536,
1997,
7434,
364,
279,
6826,
1569,
16,
327,
8039,
1399,
471,
17970,
1839,
366,
20648,
2427,
8395,
... | |
int *alignement = p[1] | int *alignment = p[1] | static def _print_wordwrap_cb(int a, b, void *data): void **p = data char *text = p[0] int *alignement = p[1] char s[b - a + 1] strncpy(s, text + a, b - a + 1) s[b - a] = 0 land_print_string(s, 1, *alignement) | bfbdc17cfb9650eed81eb71f02e1137ba3225959 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/930/bfbdc17cfb9650eed81eb71f02e1137ba3225959/font.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
760,
1652,
389,
1188,
67,
1095,
4113,
67,
7358,
12,
474,
279,
16,
324,
16,
918,
380,
892,
4672,
918,
2826,
84,
273,
501,
1149,
380,
955,
273,
293,
63,
20,
65,
509,
380,
14409,
273,
293,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
760,
1652,
389,
1188,
67,
1095,
4113,
67,
7358,
12,
474,
279,
16,
324,
16,
918,
380,
892,
4672,
918,
2826,
84,
273,
501,
1149,
380,
955,
273,
293,
63,
20,
65,
509,
380,
14409,
273,
293,
... |
self.tagpopup = self.wTree.get_widget("TagContextMenu") self.donebutton = self.wTree.get_widget("mark_as_done_b") self.dismissbutton = self.wTree.get_widget("dismiss") | self.tagpopup = self.wTree.get_widget("TagContextMenu") self.tb_task_menu_popup = self.wTree.get_widget("TbTaskMenu") self.donebutton = self.wTree.get_widget("mark_as_done_b") self.dismissbutton = self.wTree.get_widget("dismiss") self.about = self.wTree.get_widget("aboutdialog1") | def __init__(self, requester): #Set the Glade file self.gladefile = GnomeConfig.GLADE_FILE self.wTree = gtk.glade.XML(self.gladefile) #Get the Main Window, and connect the "destroy" event self.window = self.wTree.get_widget("MainWindow") if (self.window): self.window.connect("destroy", gtk.main_quit) self.window.set_icon_from_file("data/16x16/app/gtg.png") | 522d298839ef92c4433c6411f0c76d23b26f3a04 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8234/522d298839ef92c4433c6411f0c76d23b26f3a04/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
19961,
4672,
225,
468,
694,
326,
15157,
2486,
585,
365,
18,
7043,
69,
536,
398,
273,
611,
82,
1742,
809,
18,
43,
2534,
1639,
67,
3776,
365,
18,
91,
247... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
19961,
4672,
225,
468,
694,
326,
15157,
2486,
585,
365,
18,
7043,
69,
536,
398,
273,
611,
82,
1742,
809,
18,
43,
2534,
1639,
67,
3776,
365,
18,
91,
247... |
def findDepth(self, insts): | def findDepth(self, insts, debug=0): | def findDepth(self, insts): depth = 0 maxDepth = 0 for i in insts: opname = i[0] delta = self.effect.get(opname, 0) if delta > 1: depth = depth + delta elif delta < 0: if depth > maxDepth: maxDepth = depth depth = depth + delta else: if depth > maxDepth: maxDepth = depth # now check patterns for pat, pat_delta in self.patterns: if opname[:len(pat)] == pat: delta = pat_delta depth = depth + delta break # if we still haven't found a match if delta == 0: meth = getattr(self, opname, None) if meth is not None: depth = depth + meth(i[1]) if depth < 0: depth = 0 return maxDepth | 71cf824f0d02426ad5dc6874e27a3b0aa12b70fa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/71cf824f0d02426ad5dc6874e27a3b0aa12b70fa/pyassem.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
6148,
12,
2890,
16,
1804,
87,
16,
1198,
33,
20,
4672,
3598,
273,
374,
22074,
273,
374,
364,
277,
316,
1804,
87,
30,
30273,
273,
277,
63,
20,
65,
3622,
273,
365,
18,
13867,
18,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1104,
6148,
12,
2890,
16,
1804,
87,
16,
1198,
33,
20,
4672,
3598,
273,
374,
22074,
273,
374,
364,
277,
316,
1804,
87,
30,
30273,
273,
277,
63,
20,
65,
3622,
273,
365,
18,
13867,
18,
... |
msg = Message.UserNotification( mlist.getMemberCPAddress(email), mlist.GetAdminEmail(), _('Mailman privacy alert'), _("""\ | mlang = mlist.getMemberLanguage(email) otrans = i18n.get_translation() i18n.set_language(mlang) try: msg = Message.UserNotification( mlist.getMemberCPAddress(email), mlist.GetAdminEmail(), _('Mailman privacy alert'), _("""\ | def process_form(mlist, doc, cgidata, lang): listowner = mlist.GetOwnerEmail() realname = mlist.real_name results = [] # The email address being subscribed, required email = cgidata.getvalue('email', '') if not email: results.append(_('You must supply a valid email address.')) # The full name of the subscribee, optional fullname = cgidata.getvalue('fullname', '') # Who was doing the subscribing? remote = os.environ.get('REMOTE_HOST', os.environ.get('REMOTE_ADDR', 'unidentified origin')) # Was an attempt made to subscribe the list to itself? if email == mlist.GetListEmail(): syslog('mischief', 'Attempt to self subscribe %s: %s', email, remote) results.append(_('You may not subscribe a list to itself!')) # If the user did not supply a password, generate one for him password = cgidata.getvalue('pw') confirmed = cgidata.getvalue('pw-conf') if password is None and confirmed is None: password = Utils.MakeRandomPassword() elif password is None or confirmed is None: results.append(_('If you supply a password, you must confirm it.')) elif password <> confirmed: results.append(_('Your passwords did not match.')) # Get the digest option for the subscription. digestflag = cgidata.getvalue('digest') if digestflag: try: digest = int(digestflag) except ValueError: digest = 0 else: digest = mlist.digest_is_default # Sanity check based on list configuration. BAW: It's actually bogus that # the page allows you to set the digest flag if you don't really get the # choice. :/ if not mlist.digestable: digest = 0 elif not mlist.nondigestable: digest = 1 if results: print_results(mlist, ERRORSEP.join(results), doc, lang) return # If this list has private rosters, we have to be careful about the # message that gets printed, otherwise the subscription process can be # used to mine for list members. It may be inefficient, but it's still # possible, and that kind of defeats the purpose of private rosters. # We'll use this string for all successful or unsuccessful subscription # results. if mlist.private_roster == 0: # Public rosters privacy_results = '' else: privacy_results = _("""\ | 91a424d74d70a42b1a3649a319d4a9a740346bdf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/91a424d74d70a42b1a3649a319d4a9a740346bdf/subscribe.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1207,
67,
687,
12,
781,
376,
16,
997,
16,
14947,
350,
396,
16,
3303,
4672,
666,
8443,
273,
312,
1098,
18,
967,
5541,
4134,
1435,
2863,
529,
273,
312,
1098,
18,
7688,
67,
529,
1686,
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,
1207,
67,
687,
12,
781,
376,
16,
997,
16,
14947,
350,
396,
16,
3303,
4672,
666,
8443,
273,
312,
1098,
18,
967,
5541,
4134,
1435,
2863,
529,
273,
312,
1098,
18,
7688,
67,
529,
1686,
2... |
self.assertEqual(self.tv.tag_configure('test', 'foreground'), | self.assertEqual(str(self.tv.tag_configure('test', 'foreground')), | def test_tag_configure(self): # Just testing parameter passing for now self.assertRaises(TypeError, self.tv.tag_configure) self.assertRaises(Tkinter.TclError, self.tv.tag_configure, 'test', sky='blue') self.tv.tag_configure('test', foreground='blue') self.assertEqual(self.tv.tag_configure('test', 'foreground'), 'blue') self.assertEqual(self.tv.tag_configure('test', foreground=None), 'blue') self.assertTrue(isinstance(self.tv.tag_configure('test'), dict)) | 14da2168474da952328a50007af061f489f3416e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/14da2168474da952328a50007af061f489f3416e/test_widgets.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2692,
67,
14895,
12,
2890,
4672,
468,
12526,
7769,
1569,
9588,
364,
2037,
365,
18,
11231,
12649,
6141,
12,
19030,
16,
365,
18,
24161,
18,
2692,
67,
14895,
13,
365,
18,
11231,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2692,
67,
14895,
12,
2890,
4672,
468,
12526,
7769,
1569,
9588,
364,
2037,
365,
18,
11231,
12649,
6141,
12,
19030,
16,
365,
18,
24161,
18,
2692,
67,
14895,
13,
365,
18,
11231,
... |
"<Server proxy for %s%s>" % | "<ServerProxy for %s%s>" % | def __repr__(self): return ( "<Server proxy for %s%s>" % (self.__host, self.__handler) ) | cd906440fbd0694e165a09262268a608df82deeb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cd906440fbd0694e165a09262268a608df82deeb/xmlrpclib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
327,
261,
3532,
2081,
3886,
364,
738,
87,
9,
87,
2984,
738,
261,
2890,
16186,
2564,
16,
365,
16186,
4176,
13,
262,
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,
1001,
12715,
972,
12,
2890,
4672,
327,
261,
3532,
2081,
3886,
364,
738,
87,
9,
87,
2984,
738,
261,
2890,
16186,
2564,
16,
365,
16186,
4176,
13,
262,
2,
-100,
-100,
-100,
-100,
-100,
-1... |
if line.action in ['SAVE','SAVENEW','SAVE/REVERT',]: | if line.action in ['SAVE', 'SAVENEW', 'SAVE/REVERT', ]: | def history(page, pagename, request): # show history as default _ = request.getText | f23aaa071053ca9885d9ca3dea13be3568ea755c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/888/f23aaa071053ca9885d9ca3dea13be3568ea755c/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4927,
12,
2433,
16,
4262,
1069,
16,
590,
4672,
468,
2405,
4927,
487,
805,
389,
273,
590,
18,
588,
1528,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4927,
12,
2433,
16,
4262,
1069,
16,
590,
4672,
468,
2405,
4927,
487,
805,
389,
273,
590,
18,
588,
1528,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
if searchfield: link_url += '&f=' + quote(searchfield); | for coll, colldef in l_colls: link_url = CFG_SITE_URL + '/search?p=' if searchpattern: link_url += quote(searchpattern) if colldef: link_url += ' ' + quote(colldef) if searchfield: link_url += '&f=' + quote(searchfield); link_url += '&rm=citation'; link_text = self.tmpl_nice_number(d_total_recs[coll], ln) out += '<td align="right"><a href="%s">%s</a></td>' % (link_url, link_text) | 23ae5cfd977e404e837b0683dea9b2a7a9fe97cc /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12027/23ae5cfd977e404e837b0683dea9b2a7a9fe97cc/websearch_templates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
364,
4508,
16,
4508,
536,
316,
328,
67,
1293,
3251,
30,
1692,
67,
718,
273,
7577,
67,
20609,
67,
1785,
397,
1173,
3072,
35,
84,
2218,
309,
1623,
4951,
30,
1692,
67,
718,
1011,
3862,
12,
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,
364,
4508,
16,
4508,
536,
316,
328,
67,
1293,
3251,
30,
1692,
67,
718,
273,
7577,
67,
20609,
67,
1785,
397,
1173,
3072,
35,
84,
2218,
309,
1623,
4951,
30,
1692,
67,
718,
1011,
3862,
12,
30... | |
state = "gone" | state = _("gone") | def run(self): | d62eb7fc2f8da5cc0b33e5d1229c2a062b1c701d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/61/d62eb7fc2f8da5cc0b33e5d1229c2a062b1c701d/proximity.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
st rdi, ss, [0, t0, rsp], "0 * env.dataSize" st rsi, ss, [0, t0, rsp], "1 * env.dataSize" st rbp, ss, [0, t0, rsp], "2 * env.dataSize" st rsp, ss, [0, t0, rsp], "3 * env.dataSize" st rbx, ss, [0, t0, rsp], "4 * env.dataSize" st rdx, ss, [0, t0, rsp], "5 * env.dataSize" st rcx, ss, [0, t0, rsp], "6 * env.dataSize" st rax, ss, [0, t0, rsp], "7 * env.dataSize" | ld rdi, ss, [0, t0, rsp], "0 * env.dataSize" ld rsi, ss, [0, t0, rsp], "1 * env.dataSize" ld rbp, ss, [0, t0, rsp], "2 * env.dataSize" ld rbx, ss, [0, t0, rsp], "4 * env.dataSize" ld rdx, ss, [0, t0, rsp], "5 * env.dataSize" ld rcx, ss, [0, t0, rsp], "6 * env.dataSize" ld rax, ss, [0, t0, rsp], "7 * env.dataSize" | def macroop POPA { st rdi, ss, [0, t0, rsp], "0 * env.dataSize" st rsi, ss, [0, t0, rsp], "1 * env.dataSize" st rbp, ss, [0, t0, rsp], "2 * env.dataSize" st rsp, ss, [0, t0, rsp], "3 * env.dataSize" st rbx, ss, [0, t0, rsp], "4 * env.dataSize" st rdx, ss, [0, t0, rsp], "5 * env.dataSize" st rcx, ss, [0, t0, rsp], "6 * env.dataSize" st rax, ss, [0, t0, rsp], "7 * env.dataSize" addi rsp, rsp, "8 * env.dataSize" | d99557534217dc59e33ca70591b52d9d9e8322a8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6787/d99557534217dc59e33ca70591b52d9d9e8322a8/stack_operations.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
11522,
556,
26839,
37,
288,
16916,
436,
3211,
16,
5202,
16,
306,
20,
16,
268,
20,
16,
12049,
6487,
315,
20,
380,
1550,
18,
892,
1225,
6,
16916,
3597,
77,
16,
5202,
16,
306,
20,
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,
11522,
556,
26839,
37,
288,
16916,
436,
3211,
16,
5202,
16,
306,
20,
16,
268,
20,
16,
12049,
6487,
315,
20,
380,
1550,
18,
892,
1225,
6,
16916,
3597,
77,
16,
5202,
16,
306,
20,
16,
... |
Plot a gradient field | Plot a gradient field:: | def plot_vector_field((f, g), xrange, yrange, **options): r""" \code{plot_vector_field} takes two functions of two variables xvar and yvar (for instance, if the variables are $x$ and $y$, take $(f(x,y), g(x,y))$) and plots vector arrows of the function over the specified ranges, with xrange being of xvar between xmin and xmax and yrange similarly (see below). plot_vector_field((f, g), (xvar, xmin, xmax), (yvar, ymin, ymax)) EXAMPLES: Plot the vector fields involving sin and cos sage: x,y = var('x y') sage: plot_vector_field((sin(x), cos(y)), (x,-3,3), (y,-3,3)) sage: plot_vector_field(( y, (cos(x)-2)*sin(x)), (x,-pi,pi), (y,-pi,pi)) Plot a gradient field sage: u,v = var('u v') sage: f = exp(-(u^2+v^2)) sage: plot_vector_field(f.gradient(), (u,-2,2), (v,-2,2)) We ignore function values that are infinite or NaN. sage: x,y = var('x,y') sage: plot_vector_field( (-x/sqrt(x^2+y^2), -y/sqrt(x^2+y^2)), (x, -10, 10), (y, -10, 10)) sage: plot_vector_field( (-x/sqrt(x+y), -y/sqrt(x+y)), (x, -10, 10), (y, -10, 10)) """ from sage.plot.plot import setup_for_eval_on_grid, Graphics z, xstep, ystep, xrange, yrange = setup_for_eval_on_grid([f,g], xrange, yrange, options['plot_points']) f,g = z xpos_array, ypos_array, xvec_array, yvec_array = [],[],[],[] for x in xsrange(xrange[0], xrange[1], xstep, include_endpoint=True): for y in xsrange(yrange[0], yrange[1], ystep, include_endpoint=True): xpos_array.append(x) ypos_array.append(y) xvec_array.append(f(x,y)) yvec_array.append(g(x,y)) import numpy xvec_array = numpy.ma.masked_invalid(numpy.array(xvec_array, dtype=float)) yvec_array = numpy.ma.masked_invalid(numpy.array(yvec_array, dtype=float)) g = Graphics() g.add_primitive(PlotField(xpos_array, ypos_array, xvec_array, yvec_array, options)) return g | b39a838c560927994d5f1cd0239aaf60298ce479 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/b39a838c560927994d5f1cd0239aaf60298ce479/plot_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
67,
7737,
67,
1518,
12443,
74,
16,
314,
3631,
12314,
16,
677,
3676,
16,
2826,
2116,
4672,
436,
8395,
225,
521,
710,
95,
4032,
67,
7737,
67,
1518,
97,
5530,
2795,
4186,
434,
2795,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
67,
7737,
67,
1518,
12443,
74,
16,
314,
3631,
12314,
16,
677,
3676,
16,
2826,
2116,
4672,
436,
8395,
225,
521,
710,
95,
4032,
67,
7737,
67,
1518,
97,
5530,
2795,
4186,
434,
2795,... |
if pkgtup not in self.installed: | willInstall = 1 if self.installdict.has_key((name, None)): for (ins_a, ins_e, ins_v, ins_r) in self.installdict[(name, None)]: pkgver = (epoch, ver, rel) installedver = (ins_e, ins_v, ins_r) if self.returnNewest((pkgver, installedver)) == installedver: willInstall = 0 break if willInstall: | def doObsoletes(self): """figures out what things available obsolete things installed, returns them in a dict attribute of the class.""" | e60735598f43a6fc7f26e6c26cbe91ee816615bb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5445/e60735598f43a6fc7f26e6c26cbe91ee816615bb/updates.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
27637,
355,
278,
281,
12,
2890,
4672,
3536,
470,
1823,
596,
4121,
9198,
2319,
27191,
9198,
5876,
16,
1135,
2182,
316,
279,
2065,
1566,
434,
326,
667,
12123,
2,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
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,
741,
27637,
355,
278,
281,
12,
2890,
4672,
3536,
470,
1823,
596,
4121,
9198,
2319,
27191,
9198,
5876,
16,
1135,
2182,
316,
279,
2065,
1566,
434,
326,
667,
12123,
2,
-100,
-100,
-100,
-10... |
parts, packages = self._partBuilder.getPackages(partIncludes, smartExclude, classList, collapseCfg, variants, minPackageSize, minPackageSizeForUnshared) | partPackages, packageClasses = self._partBuilder.getPackages(partIncludes, smartExclude, classList, collapseCfg, variants, minPackageSize, minPackageSizeForUnshared) | def run(self): config = self._job job = self._job | 325283a1de606c1d8eea1f5285caf664c9dbf165 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/325283a1de606c1d8eea1f5285caf664c9dbf165/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
642,
273,
365,
6315,
4688,
1719,
565,
273,
365,
6315,
4688,
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,
1086,
12,
2890,
4672,
642,
273,
365,
6315,
4688,
1719,
565,
273,
365,
6315,
4688,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._policy._now = self._now = int(time.time()) cookies = self._cookies_for_request(request) attrs = self._cookie_attrs(cookies) if attrs: if not request.has_header("Cookie"): request.add_unredirected_header( "Cookie", "; ".join(attrs)) if (self._policy.rfc2965 and not self._policy.hide_cookie2 and not request.has_header("Cookie2")): for cookie in cookies: if cookie.version != 1: request.add_unredirected_header("Cookie2", '$Version="1"') break self._cookies_lock.release() | try: self._policy._now = self._now = int(time.time()) cookies = self._cookies_for_request(request) attrs = self._cookie_attrs(cookies) if attrs: if not request.has_header("Cookie"): request.add_unredirected_header( "Cookie", "; ".join(attrs)) if (self._policy.rfc2965 and not self._policy.hide_cookie2 and not request.has_header("Cookie2")): for cookie in cookies: if cookie.version != 1: request.add_unredirected_header("Cookie2", '$Version="1"') break finally: self._cookies_lock.release() | def add_cookie_header(self, request): """Add correct Cookie: header to request (urllib2.Request object). | 29ff461c832c6677f89aa644893e4ff679393b61 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/29ff461c832c6677f89aa644893e4ff679393b61/cookielib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
8417,
67,
3374,
12,
2890,
16,
590,
4672,
3536,
986,
3434,
10201,
30,
1446,
358,
590,
261,
718,
2941,
22,
18,
691,
733,
2934,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
8417,
67,
3374,
12,
2890,
16,
590,
4672,
3536,
986,
3434,
10201,
30,
1446,
358,
590,
261,
718,
2941,
22,
18,
691,
733,
2934,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
cell_1_left = "<small><strong>Search for:</strong></small><br>" + create_matchtype_box('m1', m1) + \ | cell_1_left = create_matchtype_box('m1', m1) + \ | def create_search_box(cc, colls, p, f, rg, sf, so, sp, of, ot, as, p1, f1, m1, op1, p2, f2, m2, op2, p3, f3, m3, sc, d1y, d1m, d1d, d2y, d2m, d2d): "Create search box for 'search again in the results page' functionality." out = "" # print search box prolog: out += """ <form action="%s/search.py" method="get"> <strong class="headline"><span class="h1">%s</span></strong> <input type="hidden" name="cc" value="%s"> <input type="hidden" name="as" value="%s"> """ % (weburl, cc, cc, as) if ot: out += """<input type="hidden" name="ot" value="%s">""" % ot if sp: out += """<input type="hidden" name="sp" value="%s">""" % sp # possibly print external search engines links (Google box): if cfg_google_box: out += """<table align="right"><tr><td>%s</td></tr></table>""" % create_google_box(p, f, p1, p2, p3) out += "<table>" # firstly, print Query box: if as==1: # print Advanced Search form: # define search box elements: cell_1_left = "<small><strong>Search for:</strong></small><br>" + create_matchtype_box('m1', m1) + \ """<input type="text" name="p1" size="%d" value="%s">""" % (cfg_advancedsearch_pattern_box_width, cgi.escape(p1,1)) cell_1_right = "<small><strong>within:</strong></small><br>%s" % create_searchwithin_selection_box('f1', f1) cell_1_moreright = create_andornot_box('op1', op1) cell_1_farright = "" cell_2_left = create_matchtype_box('m2', m2) + """<input type="text" name="p2" size="%d" value="%s">""" % (cfg_advancedsearch_pattern_box_width, cgi.escape(p2,1)) cell_2_right = create_searchwithin_selection_box('f2', f2) cell_2_moreright = create_andornot_box('op2', op2) cell_2_farright = "" cell_3_left = create_matchtype_box('m3', m3) + """<input type="text" name="p3" size="%d" value="%s">""" % (cfg_advancedsearch_pattern_box_width, cgi.escape(p3,1)) cell_3_right = create_searchwithin_selection_box('f3', f3) cell_3_moreright = """<input type="submit" name="search" value="SEARCH"><input type="submit" name="search" value="Browse"> """ cell_3_farright = """<small class="light"><a href="%s/search.py?p=%s&f=%s&cc=%s">Simple Search</a></small> <br><small><a href="%s/help/search/tips.html">Search Tips</a></small>""" % \ (weburl, urllib.quote(p1), urllib.quote(f1), urllib.quote(cc), weburl) # print them: out += """ <tr> <td valign="top" nowrap> <table> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> </table> </td> </tr>""" % \ (cell_1_left, cell_1_right, cell_1_moreright, cell_1_farright, \ cell_2_left, cell_2_right, cell_2_moreright, cell_2_farright, \ cell_3_left, cell_3_right, cell_3_moreright, cell_3_farright) else: # print Simple Search form: cell_1_left = """<small><strong>Search for:</strong></small> <br><input type="text" name="p" size="%d" value="%s">""" % \ (cfg_simplesearch_pattern_box_width, cgi.escape(p, 1)) cell_1_middle = "<small><strong>within:</strong></small><br>%s" % create_searchwithin_selection_box('f', f) cell_1_right = """<input type="submit" name="search" value="SEARCH"><input type="submit" name="search" value="Browse"> """ cell_1_farright = """<small class="light"><a href="%s/search.py?p1=%s&f1=%s&as=1&cc=%s">Advanced Search</a></small> <br><small><a href="%s/help/search/tips.html">Search Tips</a></small>""" %\ (weburl, urllib.quote(p), urllib.quote(f), urllib.quote(cc), weburl) out += """ <tr> <td valign="top" nowrap> <table> <tr valign="bottom"> <td>%s</td> <td>%s</td> <td>%s</td> <td>%s</td> </tr> </table> </td> </tr> """ % (cell_1_left, cell_1_middle, cell_1_right, cell_1_farright) # secondly, print Collection(s) box: out += """ <tr> <td valign="top"> <small><strong>Search collections:</strong></small><br>""" colls_nicely_ordered = get_nicely_ordered_collection_list() if colls and colls[0] != cdsname: # some collections are defined, so print these first, and only then print 'add another collection' heading: for c in colls: if c: out += """<select name="c"><option value="">*** remove this collection ***""" for (cx, cx_printable) in colls_nicely_ordered: # print collection: if not cx.startswith("Unnamed collection"): out+= """<option value="%s"%s>%s""" % (cx, is_selected(c, re.sub("^[\s\-]*","",cx)), cx_printable) out += """</select>""" out += """<select name="c"><option value="">*** add another collection ***""" else: # we searched in CDSNAME, so print 'any collection' heading out += """<select name="c"><option value="">*** any collection ***""" for (cx, cx_printable) in colls_nicely_ordered: if not cx.startswith("Unnamed collection"): out += """<option value="%s">%s""" % (cx, cx_printable) out += """ </select> </td> </tr>""" # thirdly, print from/until date boxen, if applicable: if d1y=="" and d1m=="" and d1d=="" and d2y=="" and d2m=="" and d2d=="": pass # do not need it else: cell_6_a = create_inputdate_box("Added since", "d1", d1y, d1m, d1d) cell_6_b = create_inputdate_box("until", "d2", d2y, d2m, d2d) out += """<table cellpadding="3" cellspacing="0"> <tr> <td colspan="3" height="3"> </td> </tr> <tr valign="bottom"> <td>%s</td> <td>%s</td> </tr> </table>""" % \ (cell_6_a, cell_6_b) # fourthly, print Display/Sort box: cell_1_left = """<small><strong>Sort by:</strong></small><br> <select name="sf"> <option value="">- latest first -""" query = """SELECT DISTINCT(f.code),f.name FROM field AS f, collection_field_fieldvalue AS cff WHERE cff.type='soo' AND cff.id_field=f.id ORDER BY cff.score DESC, f.name ASC""" res = run_sql(query) for code, name in res: # propose found sort options: cell_1_left += """<option value="%s"%s>%s""" % (code, is_selected(sf,code), name) cell_1_left += """</select>""" cell_1_left += """<select name="so"> <option value="a"%s>asc. <option value="d"%s>desc. </select>""" % (is_selected(so,"a"),is_selected(so,"d")) cell_1_right = """<small><strong>Output format:</strong></small><br> <select name="of">""" query = """SELECT code,name FROM format ORDER BY name ASC""" res = run_sql(query) if res: # propose found formats: for code, name in res: cell_1_right += """<option value="%s"%s>%s""" % (code, is_selected(of,code), name) else: # no formats are found, so propose the default HTML one: cell_1_right += """<option value="hb"%s>HTML brief""" % (is_selected(of,"hb")) # is format made of numbers only? if yes, then propose it too: if of and str(of[0:3]).isdigit(): cell_1_right += """<option value="%s" selected>%s MARC tag""" % (of, of) cell_1_right += """</select>""" ## okay, formats ended cell_1_middle = """<small><strong>Display results:</strong></small><br> <select name="rg"> <option value="10"%s>10 results <option value="25"%s>25 results <option value="50"%s>50 results <option value="100"%s>100 results <option value="250"%s>250 results <option value="500"%s>500 results </select> <select name="sc"> <option value="0"%s>grouped together <option value="1"%s>split by collection </select> """ % (is_selected(rg,"10"), is_selected(rg,"25"), is_selected(rg,"50"), \ is_selected(rg,"100"), is_selected(rg,"250"), is_selected(rg,"500"),\ is_selected(sc,"0"), is_selected(sc,"1")) out += """ <tr> <td valign="top"> <table><tr valign="top"><td>%s</td><td>%s</td><td>%s</td></tr></table> </td> </tr>""" % (cell_1_left, cell_1_middle, cell_1_right) # print end of search box: out += """</table></form> """ return out | 620cac641ba839b8d458726c5bcd42752af2f02c /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/620cac641ba839b8d458726c5bcd42752af2f02c/search_engine.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3072,
67,
2147,
12,
952,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
16,
9033,
16,
1427,
16,
1694,
16,
434,
16,
15835,
16,
487,
16,
293,
21,
16,
284,
21,
16,
312,
21,
16... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
3072,
67,
2147,
12,
952,
16,
645,
3251,
16,
293,
16,
284,
16,
14524,
16,
9033,
16,
1427,
16,
1694,
16,
434,
16,
15835,
16,
487,
16,
293,
21,
16,
284,
21,
16,
312,
21,
16... |
Result: The product id for the respective name or 0 if an error occurs. """ return self.do_command("Product.lookup_id_by_name", [self._string_noop(name)]) | Result: The product id for the respective name """ prodDict = self.do_command('Product.check_product', [self._string_noop(name)]) return prodDict['id'] def product_check_by_name(self, name): return self.do_command("Product.check_product", [self._string_noop(name)]) | def product_lookup_id_by_name(self, name): """Lookup A Product ID By Its Name. | 83012e559756373ef19add9ed3d26f1bf779a22c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/231/83012e559756373ef19add9ed3d26f1bf779a22c/testopia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
8664,
67,
350,
67,
1637,
67,
529,
12,
2890,
16,
508,
4672,
3536,
6609,
432,
8094,
1599,
2525,
29517,
1770,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3017,
67,
8664,
67,
350,
67,
1637,
67,
529,
12,
2890,
16,
508,
4672,
3536,
6609,
432,
8094,
1599,
2525,
29517,
1770,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
queryparser = os.path.join(chandlerBin, queryparser) | def generateDocs(options, outputDir): if options.verbose: verbosity = 4 else: verbosity = 1 if sys.platform == 'cygwin' or os.name == 'nt': chandlerdb = 'release/bin/Lib/site-packages/chandlerdb' queryparser = 'release/bin/Lib/site-packages/QueryParser.py' pyicu = 'release/bin/Lib/site-packages/PyICU.py' pylucene = 'release/bin/Lib/site-packages/PyLucene.py' elif sys.platform == 'darwin': chandlerdb = 'release/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/chandlerdb' queryparser = 'release/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/QueryParser.py' pyicu = 'release/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PyICU.py' pylucene = 'release/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/PyLucene.py' else: chandlerdb = 'release/lib/python2.4/site-packages/chandlerdb' queryparser = 'release/lib/python2.4/site-packages/QueryParser.py' pyicu = 'release/lib/python2.4/site-packages/PyICU.py' pylucene = 'release/lib/python2.4/site-packages/PyLucene.py' chandlerBin = os.getenv('CHANDLERBIN') chandlerdb = os.path.join(chandlerBin, chandlerdb) queryparser = os.path.join(chandlerBin, queryparser) pyicu = os.path.join(chandlerBin, pyicu) pylucene = os.path.join(chandlerBin, pylucene) targetDir = os.path.join(outputDir, 'api') if not os.path.isdir(targetDir): _mkdirs(targetDir) # This is the options dictionary # It is used by most of the epydoc routines and # the contents were determined by examining epydoc/gui.py # and epydoc/cli.py e_options = { 'target': targetDir, 'verbosity': verbosity, 'prj_name': 'Chandler', 'action': 'html', 'tests': { 'basic': 1 }, 'show_imports': 0, 'frames': 1, 'private': 0, 'debug': 0, 'docformat': None, 'top': None, 'inheritance': "listed", 'alphabetical': 1, 'ignore_param_mismatch': 1, 'list_classes_separately': 0, 'modules': ['application', 'i18n', 'parcels/feeds', 'parcels/osaf', 'parcels/osaf/app', 'parcels/osaf/examples', 'parcels/osaf/framework', 'parcels/osaf/mail', 'parcels/osaf/pim', 'parcels/osaf/servlets', 'parcels/osaf/sharing', 'parcels/osaf/tests', 'parcels/osaf/views', 'parcels/photos', 'repository', 'samples/skeleton', 'tools', 'util', 'Chandler.py', 'version.py', chandlerdb, # This comes from internal queryparser, # This comes from external pyicu, # This comes from external pylucene, # This comes from external ], } # based on the code in epydoc's gui.py # with subtle changes made to make it work :) from epydoc.html import HTMLFormatter from epydoc.objdoc import DocMap, report_param_mismatches from epydoc.imports import import_module, find_modules from epydoc.objdoc import set_default_docformat set_default_docformat('epytext') try: modules = [] module_names = e_options['modules'] # walk thru list of modules and expand # any packages found for name in module_names[:]: if os.path.isdir(name): index = module_names.index(name) new_modules = find_modules(name) if new_modules: module_names[index:index+1] = new_modules elif options.verbose: print 'Error: %s is not a package' % name # basic regex to exclude directories from consideration exc = re.compile(".*tests.*|.*scripts.*") for name in module_names: if exc.match(name): continue if options.verbose: print 'IMPORT: %s' % name # try importing the module and # add it to the list if successful try: module = import_module(name) if module not in modules: modules.append(module) elif options.verbose: print ' (duplicate)' except ImportError, e: if options.verbose: print e if len(modules) == 0: print 'Error: no modules successfully loaded!' sys.exit(1) document_bases = 1 document_autogen_vars = 1 inheritance_groups = (e_options['inheritance'] == 'grouped') inherit_groups = (e_options['inheritance'] != 'grouped') # let epydoc create an empty document map d = DocMap(verbosity, document_bases, document_autogen_vars, inheritance_groups, inherit_groups) # walk the module list and let epydoc build the documentation for (module, num) in zip(modules, range(len(modules))): if options.verbose: print '\n***Building docs for %s***' % module.__name__ try: d.add(module) except Exception, e: print "Internal Error: %s" % e except: print "Internal Error" if not e_options['ignore_param_mismatch']: if not report_param_mismatches(d): print ' (To supress these warnings, use --ignore-param-mismatch)' htmldoc = HTMLFormatter(d, **e_options) numfiles = htmldoc.num_files() def progress_callback(path): (dir, file) = os.path.split(path) (root, d) = os.path.split(dir) if d in ('public', 'private'): fname = os.path.join(d, file) else: fname = file if options.verbose: print '\n***Writing %s***' % fname # Write the documentation. print "\n***Saving to %s" % targetDir htmldoc.write(targetDir, progress_callback) except Exception, e: print 'Internal error: ', e raise except: raise | fb002db03d47b9ce762eb7c6c81d990b789b7a03 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/fb002db03d47b9ce762eb7c6c81d990b789b7a03/gen_docs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12656,
12,
2116,
16,
21412,
4672,
309,
702,
18,
11369,
30,
11561,
273,
1059,
469,
30,
11561,
273,
404,
225,
309,
2589,
18,
9898,
422,
296,
2431,
75,
8082,
11,
578,
1140,
18,
529,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
12656,
12,
2116,
16,
21412,
4672,
309,
702,
18,
11369,
30,
11561,
273,
1059,
469,
30,
11561,
273,
404,
225,
309,
2589,
18,
9898,
422,
296,
2431,
75,
8082,
11,
578,
1140,
18,
529,... | |
J = I.submodule_with_basis(self.free_module().basis(), check=False) | J = I.submodule(self.free_module().basis(), check=False, already_echelonized=True) | def integral_structure(self): r""" Return the $\Z$-structure of this modular symbols spaces generated by all integral modular symbols. | b20b80e30de5f9172088327385e7dbe52af87824 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/b20b80e30de5f9172088327385e7dbe52af87824/space.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21423,
67,
7627,
12,
2890,
4672,
436,
8395,
2000,
326,
271,
64,
62,
8,
17,
7627,
434,
333,
681,
2490,
7963,
7292,
4374,
635,
777,
21423,
681,
2490,
7963,
18,
2,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21423,
67,
7627,
12,
2890,
4672,
436,
8395,
2000,
326,
271,
64,
62,
8,
17,
7627,
434,
333,
681,
2490,
7963,
7292,
4374,
635,
777,
21423,
681,
2490,
7963,
18,
2,
-100,
-100,
-100,
-100,... |
formGen=widgets.Form.formGen formGen['intmenu']=widgets.htmlFor_menu formFields = [ ["intmenu","Day","day",map(str,range(1,32))], ["menu","Month","month",calendar.month_name[1:]], ["int","Year","year",str(time.localtime(time.time())[0])], ["string","Title","title",""], ["text","Data","data",""] ] formParse = { 'int':int, 'intmenu':int } def __init__(self,page): self.page=page def process(self,write,request,day,month,year,title,data): month=calendar.month_name.index(month) self.page.setDay(day,month,year,title,data) return [self.page.backToCalendar(request)] | formGen=widgets.Form.formGen formGen['intmenu']=widgets.htmlFor_menu formFields = [ ["intmenu","Day","day",map(str,range(1,32))], ["menu","Month","month",calendar.month_name[1:]], ["int","Year","year",str(time.localtime(time.time())[0])], ["string","Title","title",""], ["text","Data","data",""] ] formParse = { 'int':int, 'intmenu':int } def __init__(self,page): self.page=page def process(self,write,request,day,month,year,title,data): month=calendar.month_name.index(month) self.page.setDay(day,month,year,title,data) return [self.page.backToCalendar(request)] | def stream(self,write,request): write('''<table border=0 cellpadding=2 width=100%> | 30759998c75b86e70ebd23c284f5d1c1a334850f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/30759998c75b86e70ebd23c284f5d1c1a334850f/cal.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1407,
12,
2890,
16,
2626,
16,
2293,
4672,
1045,
2668,
6309,
32,
2121,
5795,
33,
20,
2484,
9598,
33,
22,
1835,
33,
6625,
9,
34,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1407,
12,
2890,
16,
2626,
16,
2293,
4672,
1045,
2668,
6309,
32,
2121,
5795,
33,
20,
2484,
9598,
33,
22,
1835,
33,
6625,
9,
34,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
[(1, 5, 12), (2, 9, 19), (3, 13, 17), (4, 8, 15), (6, 16, 20), (7, 11, 18), (10, 14, 21)] | [(1, 15, 8), (2, 16, 12), (3, 20, 4), (5, 7, 18), (6, 14, 10), (9, 11, 19), (13, 21, 17)] | def tau123(T1, T2): """ Compute the tau_i representation for a bitrade (T1, T2). See the functions tau1, tau2, and tau3 for the mathematical definitions. RETURNS: (cells_map, t1, t2, t3) where cells_map is a map to/from the filled cells of T1, and t1, t2, t3 are the tau1, tau2, tau3 permutations. EXAMPLES: sage: from sage.combinat.matrices.latin import * sage: (a, b, c, G) = pq_group_bitrade_generators(3, 7) sage: (T1, T2) = bitrade_from_group(a, b, c, G) sage: print T1 [0 6 4] [1 0 5] [2 1 6] [3 2 0] [4 3 1] [5 4 2] [6 5 3] sage: print T2 [6 4 0] [0 5 1] [1 6 2] [2 0 3] [3 1 4] [4 2 5] [5 3 6] sage: (cells_map, t1, t2, t3) = tau123(T1, T2) sage: print cells_map {1: (0, 0), 2: (0, 1), 3: (0, 2), 4: (1, 0), 5: (1, 1), 6: (1, 2), 7: (2, 0), 8: (2, 1), 9: (2, 2), 10: (3, 0), 11: (3, 1), 12: (3, 2), 13: (4, 0), (2, 1): 8, 15: (4, 2), 16: (5, 0), 17: (5, 1), 18: (5, 2), 19: (6, 0), 20: (6, 1), 21: (6, 2), (5, 1): 17, (4, 0): 13, (1, 2): 6, (3, 0): 10, (5, 0): 16, (2, 2): 9, (4, 1): 14, (1, 1): 5, (3, 2): 12, (0, 0): 1, (6, 0): 19, 14: (4, 1), (4, 2): 15, (1, 0): 4, (0, 1): 2, (6, 1): 20, (3, 1): 11, (2, 0): 7, (6, 2): 21, (5, 2): 18, (0, 2): 3} sage: print cells_map_as_square(cells_map, max(T1.nrows(), T1.ncols())) [ 1 2 3 -1 -1 -1 -1] [ 4 5 6 -1 -1 -1 -1] [ 7 8 9 -1 -1 -1 -1] [10 11 12 -1 -1 -1 -1] [13 14 15 -1 -1 -1 -1] [16 17 18 -1 -1 -1 -1] [19 20 21 -1 -1 -1 -1] sage: t1 [3, 1, 2, 6, 4, 5, 9, 7, 8, 12, 10, 11, 15, 13, 14, 18, 16, 17, 21, 19, 20] sage: t2 [19, 17, 12, 1, 20, 15, 4, 2, 18, 7, 5, 21, 10, 8, 3, 13, 11, 6, 16, 14, 9] sage: print t3 [5, 9, 13, 8, 12, 16, 11, 15, 19, 14, 18, 1, 17, 21, 4, 20, 3, 7, 2, 6, 10] sage: t1.to_cycles() [(1, 3, 2), (4, 6, 5), (7, 9, 8), (10, 12, 11), (13, 15, 14), (16, 18, 17), (19, 21, 20)] sage: t2.to_cycles() [(1, 19, 16, 13, 10, 7, 4), (2, 17, 11, 5, 20, 14, 8), (3, 12, 21, 9, 18, 6, 15)] sage: t3.to_cycles() [(1, 5, 12), (2, 9, 19), (3, 13, 17), (4, 8, 15), (6, 16, 20), (7, 11, 18), (10, 14, 21)] The product t1*t2*t3 is the identity, i.e. it fixes every point: sage: len((t1*t2*t3).fixed_points()) == T1.nr_filled_cells() True """ assert is_bitrade(T1, T2) cells_map = T1.filled_cells_map() t1 = tau1(T1, T2, cells_map) t2 = tau2(T1, T2, cells_map) t3 = tau3(T1, T2, cells_map) return (cells_map, t1, t2, t3) | 79588eb9f6225f31a0fe90ef3cb590193d4561c1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/79588eb9f6225f31a0fe90ef3cb590193d4561c1/latin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12284,
12936,
12,
56,
21,
16,
399,
22,
4672,
3536,
8155,
326,
12284,
67,
77,
4335,
364,
279,
2831,
354,
323,
261,
56,
21,
16,
399,
22,
2934,
2164,
326,
4186,
12284,
21,
16,
12284,
22... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12284,
12936,
12,
56,
21,
16,
399,
22,
4672,
3536,
8155,
326,
12284,
67,
77,
4335,
364,
279,
2831,
354,
323,
261,
56,
21,
16,
399,
22,
2934,
2164,
326,
4186,
12284,
21,
16,
12284,
22... |
try: message = message.encode(self.factory.encoding) except UnicodeEncodeError: log.err(None, 'Could not encode message to %s.' % user) return | def msg(self, user, message): self.call_handlers('msg', user, [user, message]) | 291d4b3f6ad2bc6800b65dd9dcec7bbdca8ac38b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6476/291d4b3f6ad2bc6800b65dd9dcec7bbdca8ac38b/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1234,
12,
2890,
16,
729,
16,
883,
4672,
365,
18,
1991,
67,
11046,
2668,
3576,
2187,
729,
16,
306,
1355,
16,
883,
5717,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1234,
12,
2890,
16,
729,
16,
883,
4672,
365,
18,
1991,
67,
11046,
2668,
3576,
2187,
729,
16,
306,
1355,
16,
883,
5717,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... | |
else | else: | def __init__(data = None) if data == None: quickfix.BoolField.__init__(self, 719) else quickfix.BoolField.__init__(self, 719, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
7464,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
3657,
13,
469,
30,
9549,
904,
18,
7464,
974,
16186,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
7464,
974,
16186,
2738,
972,
12,
2890,
16,
2371,
3657,
13,
469,
30,
9549,
904,
18,
7464,
974,
16186,
27... |
print "Adding a constant:" c += 5 print c | def _testme(): a = csc_matrix((arange(1, 9), numpy.transpose([[0, 1, 1, 2, 2, 3, 3, 4], [0, 1, 3, 0, 2, 3, 4, 4]]))) print "Representation of a matrix:" print repr(a) print "How a matrix prints:" print a print "Adding two matrices:" b = a+a print b print "Subtracting two matrices:" c = b - a print c print "Multiplying a sparse matrix by a dense vector:" d = a*[1, 2, 3, 4, 5] print d print [1, 2, 3, 4, 5]*a print "Inverting a sparse linear system:" print "The sparse matrix (constructed from diagonals):" a = spdiags([[1, 2, 3, 4, 5], [6, 5, 8, 9, 10]], [0, 1], 5, 5) b = numpy.array([1, 2, 3, 4, 5]) print "Solve: single precision complex:" useUmfpack = False a = a.astype('F') | b31b66aa3bb672fb49716ef246940563bd20afa0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/b31b66aa3bb672fb49716ef246940563bd20afa0/sparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3813,
3501,
13332,
279,
273,
276,
1017,
67,
5667,
12443,
297,
726,
12,
21,
16,
2468,
3631,
3972,
18,
2338,
4150,
3816,
63,
20,
16,
404,
16,
404,
16,
576,
16,
576,
16,
890,
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,
3813,
3501,
13332,
279,
273,
276,
1017,
67,
5667,
12443,
297,
726,
12,
21,
16,
2468,
3631,
3972,
18,
2338,
4150,
3816,
63,
20,
16,
404,
16,
404,
16,
576,
16,
576,
16,
890,
16,
... | |
1/0 | 1./0 | def f(p): 1/0 | 6294fee72793ac61c16b5ff2e9c17a78b67f4478 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/6294fee72793ac61c16b5ff2e9c17a78b67f4478/test_profilehooks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
84,
4672,
404,
19,
20,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
284,
12,
84,
4672,
404,
19,
20,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
kernelver = autodir + '/src/linux-2.6.14.tar.bz2', config = autodir + "/bin/tests/kernbench/config"): | kernelver = '/usr/local/src/linux-2.6.14.tar.bz2', config = os.environ['AUTODIRBIN'] + "/tests/kernbench/config"): | def setup(self, iterations = 1, threads = 2 * count_cpus(), kernelver = autodir + '/src/linux-2.6.14.tar.bz2', config = autodir + "/bin/tests/kernbench/config"): print "kernbench -j %d -i %d -c %s -k %s" % (threads, iterations, config, kernelver) | e79073f7798047b6a42f9f644ea21a00152cdd5b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12268/e79073f7798047b6a42f9f644ea21a00152cdd5b/kernbench.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
16,
11316,
273,
404,
16,
7403,
273,
576,
380,
1056,
67,
20696,
9334,
5536,
502,
273,
1173,
13640,
19,
3729,
19,
4816,
19,
20132,
17,
22,
18,
26,
18,
3461,
18,
11718,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
12,
2890,
16,
11316,
273,
404,
16,
7403,
273,
576,
380,
1056,
67,
20696,
9334,
5536,
502,
273,
1173,
13640,
19,
3729,
19,
4816,
19,
20132,
17,
22,
18,
26,
18,
3461,
18,
11718,
... |
for line in self._exc_info_to_string(error, test).splitlines(): self._stream.write("%s\n" % line) | for line in self._exc_info_to_unicode(error, test).splitlines(): self._stream.write(("%s\n" % line).encode('utf8')) | def _addOutcome(self, outcome, test, error=None, details=None): """Report a failure in test test. Only one of error and details should be provided: conceptually there are two separate methods: addOutcome(self, test, error) addOutcome(self, test, details) | 811e35ca81232d4aaa814395fb6cf5501aa9aa6f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6381/811e35ca81232d4aaa814395fb6cf5501aa9aa6f/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
1289,
19758,
12,
2890,
16,
12884,
16,
1842,
16,
555,
33,
7036,
16,
3189,
33,
7036,
4672,
3536,
4820,
279,
5166,
316,
1842,
1842,
18,
225,
5098,
1245,
434,
555,
471,
3189,
1410,
50... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1289,
19758,
12,
2890,
16,
12884,
16,
1842,
16,
555,
33,
7036,
16,
3189,
33,
7036,
4672,
3536,
4820,
279,
5166,
316,
1842,
1842,
18,
225,
5098,
1245,
434,
555,
471,
3189,
1410,
50... |
strainTpdt[strainComp] = strainVal stressTpdt, visStrainTpdt = self._computeStress(strainTpdt, muV, lambdaV, | strainTest = numpy.array(strainTpdt, dtype=numpy.float64) strainTest[strainComp] = strainVal stressTpdt, visStrainTpdt = self._computeStress(strainTest, muV, lambdaV, | def _calcStressComponent(self, strainVal, strainComp, stressComp, strainTpdt, muV, lambdaV, viscosityCoeffV, powerLawExpV, visStrainT, stressT, initialStress, initialStrain): """ Function to compute a particular stress component as a function of a strain component. """ strainTpdt[strainComp] = strainVal stressTpdt, visStrainTpdt = self._computeStress(strainTpdt, muV, lambdaV, viscosityCoeffV, powerLawExpV, visStrainT, stressT, initialStress, initialStrain) return stressTpdt[stressComp] | facc5b9922a313ea65cf7d34f92705b168c4dcd2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8645/facc5b9922a313ea65cf7d34f92705b168c4dcd2/PowerLaw3DTimeDep.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12448,
510,
663,
1841,
12,
2890,
16,
16853,
3053,
16,
16853,
2945,
16,
384,
663,
2945,
16,
16853,
56,
84,
7510,
16,
4129,
58,
16,
3195,
58,
16,
2281,
71,
8807,
4249,
17098,
58,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12448,
510,
663,
1841,
12,
2890,
16,
16853,
3053,
16,
16853,
2945,
16,
384,
663,
2945,
16,
16853,
56,
84,
7510,
16,
4129,
58,
16,
3195,
58,
16,
2281,
71,
8807,
4249,
17098,
58,
... |
self.compression = parse_int(oracle.resolve(self.urn, AFF4_COMPRESSION)) if self.compression is NoneObject: | self.compression = oracle.resolve(self.urn, AFF4_COMPRESSION) if isinstance(self.compression,NoneObject): | def __init__(self, urn=None, mode='r'): FileLikeObject.__init__(self, urn, mode) if urn: container = oracle.resolve(self.urn, AFF4_STORED) oracle.add(container, AFF4_CONTAINS, self.urn) | 4809bae0b45e9e3bd91ac880c7fe449aa9057a6b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5569/4809bae0b45e9e3bd91ac880c7fe449aa9057a6b/aff4.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
18412,
33,
7036,
16,
1965,
2218,
86,
11,
4672,
1387,
8804,
921,
16186,
2738,
972,
12,
2890,
16,
18412,
16,
1965,
13,
309,
18412,
30,
1478,
273,
20865,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
18412,
33,
7036,
16,
1965,
2218,
86,
11,
4672,
1387,
8804,
921,
16186,
2738,
972,
12,
2890,
16,
18412,
16,
1965,
13,
309,
18412,
30,
1478,
273,
20865,
18... |
def handler2(*args, **kargs): print "handler2", args, kargs | _exithandlers = [] def _run_exitfuncs(): """run any registered exit functions | def handler2(*args, **kargs): print "handler2", args, kargs | c19425d520527d93b82755cc8a9854388306515a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/c19425d520527d93b82755cc8a9854388306515a/atexit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
389,
338,
483,
464,
3135,
273,
5378,
1652,
389,
2681,
67,
8593,
17728,
13332,
3536,
2681,
1281,
4104,
2427,
4186,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
389,
338,
483,
464,
3135,
273,
5378,
1652,
389,
2681,
67,
8593,
17728,
13332,
3536,
2681,
1281,
4104,
2427,
4186,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
item.parent = self | self.setup_child(item) | def __setitem__(self, key, item): if isinstance(key, UnicodeType) or isinstance(key, StringType): self.attributes[str(key)] = item elif isinstance(key, IntType): item.parent = self self.children[key] = item elif isinstance(key, SliceType): assert key.step is None, 'cannot handle slice with stride' for node in item: node.parent = self self.children[key.start:key.stop] = item else: raise TypeError, ('element index must be an integer, a slice, or ' 'an attribute name string') | ce302a0be7bbc33d68baaa7a9d7f15c61a340fc9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/ce302a0be7bbc33d68baaa7a9d7f15c61a340fc9/nodes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1726,
972,
12,
2890,
16,
498,
16,
761,
4672,
309,
1549,
12,
856,
16,
9633,
559,
13,
578,
1549,
12,
856,
16,
31570,
4672,
365,
18,
4350,
63,
701,
12,
856,
25887,
273,
761,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
542,
1726,
972,
12,
2890,
16,
498,
16,
761,
4672,
309,
1549,
12,
856,
16,
9633,
559,
13,
578,
1549,
12,
856,
16,
31570,
4672,
365,
18,
4350,
63,
701,
12,
856,
25887,
273,
761,
... |
monthSizer.Add(self.monthButton, 0) | monthSizer.Add(self.monthText, 0) | def OnInit(self): self.SetBackgroundColour(self.parent.bgColor) | 868e4090af63628d14a453c6ae60d48ad7059443 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9228/868e4090af63628d14a453c6ae60d48ad7059443/CalendarCanvas.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
2570,
12,
2890,
4672,
365,
18,
694,
8199,
26404,
12,
2890,
18,
2938,
18,
12370,
2957,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2755,
2570,
12,
2890,
4672,
365,
18,
694,
8199,
26404,
12,
2890,
18,
2938,
18,
12370,
2957,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
selLine.setPoints(self.offsetX + x*self.CellWidth, self.offsetY + y*self.getCellHeight(), self.offsetX + (x+1)*self.CellWidth, self.offsetY + y*self.getCellHeight()) | selLine.setPoints(self.offsetX + x*self.CellWidth, self.offsetY + y*self.CellHeight, self.offsetX + (x+1)*self.CellWidth, self.offsetY + y*self.CellHeight) | def addSelectionLine(self, x, y, direction): selLine = QCanvasLine(self.canvas) if direction==0: #horizontal line selLine.setPoints(self.offsetX + x*self.CellWidth, self.offsetY + y*self.getCellHeight(), self.offsetX + (x+1)*self.CellWidth, self.offsetY + y*self.getCellHeight()) else: #vertical line selLine.setPoints(self.offsetX + x*self.CellWidth, self.offsetY + y*self.getCellHeight(), self.offsetX + x*self.CellWidth, self.offsetY + (y+1)*self.getCellHeight()) color = self.colorPalette.getCurrentColorSchema().getAdditionalColors()["Selected cells"] selLine.setPen(QPen(self.qrgbToQColor(color),v_sel_width)) selLine.setZ(20) selLine.show(); self.selectionLines += [selLine] | 9dec2648a439fbcedb4a6e19f89488c157b33964 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6366/9dec2648a439fbcedb4a6e19f89488c157b33964/OWDistanceMap.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
6233,
1670,
12,
2890,
16,
619,
16,
677,
16,
4068,
4672,
357,
1670,
273,
2238,
12971,
1670,
12,
2890,
18,
15424,
13,
309,
4068,
631,
20,
30,
468,
18396,
980,
357,
1670,
18,
542,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
6233,
1670,
12,
2890,
16,
619,
16,
677,
16,
4068,
4672,
357,
1670,
273,
2238,
12971,
1670,
12,
2890,
18,
15424,
13,
309,
4068,
631,
20,
30,
468,
18396,
980,
357,
1670,
18,
542,
... |
if query.id in self._queries: | if query.id in self._queries: print " ... we already know this query" | def receiveQuery(self, query): print "P2pQuerier receiveQuery : %s" % query if query.id in self._queries: return self._queries[query.id] = query | 70e252862bdd2d32e07ca2c0757038d111b2ad83 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2259/70e252862bdd2d32e07ca2c0757038d111b2ad83/p2pquerier.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6798,
1138,
12,
2890,
16,
843,
4672,
1172,
315,
52,
22,
84,
928,
264,
2453,
6798,
1138,
294,
738,
87,
6,
738,
843,
309,
843,
18,
350,
316,
365,
6315,
13748,
30,
1172,
315,
1372,
732,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6798,
1138,
12,
2890,
16,
843,
4672,
1172,
315,
52,
22,
84,
928,
264,
2453,
6798,
1138,
294,
738,
87,
6,
738,
843,
309,
843,
18,
350,
316,
365,
6315,
13748,
30,
1172,
315,
1372,
732,... |
hlr_utils.hlr_math_compatible(obj1,o1_descr,obj2,o2_descr) | hlr_utils.hlr_math_compatible(obj1, o1_descr, obj2, o2_descr) | def rebin_efficiency(obj1,obj2,**kwargs): """ This function takes two SOMs or two SOs and rebins the data for obj1 onto the axis provided by obj2. The units on the x-axes needs to be Angstroms, since this is what the efficiencies will be present as. Parameters: ---------- -> obj1 is a SOM or SO that will be rebinned -> obj2 is a SOM or SO that will provide the axis for rebinning -> kwargs is a list of key word arguments that the function accepts: units= a string containing the expected units for this function. The default for this function is Angstroms Returns: ------- <- A SOM or SO that has been rebinned Exceptions: ---------- <- TypeError is raised if the SOM-SO operation is attempted <- TypeError is raised if the SO-SOM operation is attempted <- TypeError is raised is obj1 not a SOM or SO <- TypeError is raised is obj2 not a SOM or SO <- IndexError is raised if the SOMs do not have the same number of SOs <- RuntimeError is raised if the SOM x-axis units are not Angstroms <- RuntimeError is raised if the x-axis units of the SOMs do not match """ # import the helper functions import hlr_utils # set up for working through data (result,res_descr)=hlr_utils.empty_result(obj1,obj2) (o1_descr,o2_descr)=hlr_utils.get_descr(obj1,obj2) # error checking for types if o1_descr == "SOM" and o2_descr == "SO": raise TypeError, "SOM-SO operation not supported" elif o1_descr == "SO" and o2_descr == "SOM": raise TypeError, "SO-SOM operation not supported" # Have the right object combination, go on else: pass # Setup keyword arguments try: units = kwargs["units"] except KeyError: units = "Angstroms" if o1_descr == "SOM" and o2_descr == "SOM": hlr_utils.hlr_math_compatible(obj1,o1_descr,obj2,o2_descr) # If both objects are not SOMs, do nothing else: pass result=hlr_utils.copy_som_attr(result,res_descr,obj2,o2_descr) if res_descr == "SOM": result = hlr_utils.hlr_force_units(result, "Angstroms") # Can't force units on anything other than a SOM else: pass # iterate through the values import common_lib for i in range(hlr_utils.get_length(obj1,obj2)): val1 = hlr_utils.get_value(obj1,i,o1_descr,"all") val2 = hlr_utils.get_value(obj2,i,o2_descr,"x") value=common_lib.rebin_axis_1D(val1, val2) hlr_utils.result_insert(result,res_descr,value,None,"all") return result | b71ce59d64b8722e53e1e93a78aa55e2f761ac0d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/763/b71ce59d64b8722e53e1e93a78aa55e2f761ac0d/hlr_rebin_efficiency.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
4757,
67,
73,
22217,
12,
2603,
21,
16,
2603,
22,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
2795,
348,
1872,
87,
578,
2795,
7460,
87,
471,
283,
11862,
326,
501,
364,
1081,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
4757,
67,
73,
22217,
12,
2603,
21,
16,
2603,
22,
16,
636,
4333,
4672,
3536,
1220,
445,
5530,
2795,
348,
1872,
87,
578,
2795,
7460,
87,
471,
283,
11862,
326,
501,
364,
1081,
21,
... |
'should not happen.' % (self.__class__.__name__, | 'should not happen.' % (self.__class__.__name__, | def removeForwardIndexEntry(self, entry, documentId): """Take the entry provided and remove any reference to documentId in its entry in the index. """ indexRow = self._index.get(entry, _marker) if indexRow is not _marker: try: indexRow.remove(documentId) if not indexRow: del self._index[entry] self._length.change(-1) except AttributeError: # index row is an int del self._index[entry] self._length.change(-1) except: LOG.error('%s: unindex_object could not remove ' 'documentId %s from index %s. This ' 'should not happen.' % (self.__class__.__name__, str(documentId), str(self.id)), exc_info=sys.exc_info()) else: LOG.error('%s: unindex_object tried to retrieve set %s ' 'from index %s but couldn\'t. This ' 'should not happen.' % (self.__class__.__name__, repr(entry), str(self.id))) | cfe412921b994df2e17061a3f3e4e9eacb886c4e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/cfe412921b994df2e17061a3f3e4e9eacb886c4e/UnIndex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
8514,
1016,
1622,
12,
2890,
16,
1241,
16,
28573,
4672,
3536,
13391,
326,
1241,
2112,
471,
1206,
1281,
2114,
358,
28573,
316,
2097,
1241,
316,
326,
770,
18,
3536,
770,
1999,
273,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1206,
8514,
1016,
1622,
12,
2890,
16,
1241,
16,
28573,
4672,
3536,
13391,
326,
1241,
2112,
471,
1206,
1281,
2114,
358,
28573,
316,
2097,
1241,
316,
326,
770,
18,
3536,
770,
1999,
273,
36... |
ScanSetup.createConfig(self) | ScanSetup.createConfig(self, None) | def createConfig(self): config.tuning = ConfigSubsection() config.tuning.type = configElement_nonSave("config.tuning.type", configSelection, 0, (("manual_transponder", _("Manual transponder")), ("predefined_transponder", _("Predefined satellite")))) config.tuning.sat = configElement_nonSave("config.tuning.sat", configSatlist, 192, nimmanager.getRotorSatListForNim(self.feid)) ScanSetup.createConfig(self) self.updateSats() | e9840fb1b22407e93c9be0b6b60ad63bde4b8703 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6652/e9840fb1b22407e93c9be0b6b60ad63bde4b8703/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
809,
12,
2890,
4672,
642,
18,
88,
13036,
273,
1903,
1676,
3464,
1435,
225,
642,
18,
88,
13036,
18,
723,
273,
642,
1046,
67,
5836,
4755,
2932,
1425,
18,
88,
13036,
18,
723,
3113,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
809,
12,
2890,
4672,
642,
18,
88,
13036,
273,
1903,
1676,
3464,
1435,
225,
642,
18,
88,
13036,
18,
723,
273,
642,
1046,
67,
5836,
4755,
2932,
1425,
18,
88,
13036,
18,
723,
3113,
... |
pscatter = pylab.scatter(x_ls, y_ls, edgecolor=self.analysis_method_id2color[analysis_method_id], facecolor='w') | pscatter = ax1.scatter(x_ls, y_ls, edgecolor=self.analysis_method_id2color[analysis_method_id], facecolor='w') | def drawPvalue(self, snps_within_this_region, analysis_method_id2gwr): """ 2008-09-24 """ sys.stderr.write("\t Drawing pvalues ...") analysis_method_id_ls = analysis_method_id2gwr.keys() analysis_method_id_ls.sort() pscatter_ls = [] legend_ls = [] for analysis_method_id in analysis_method_id_ls: gwr = analysis_method_id2gwr[analysis_method_id] x_ls, y_ls = self.getXY(snps_within_this_region, analysis_method_id2gwr, analysis_method_id) pscatter = pylab.scatter(x_ls, y_ls, edgecolor=self.analysis_method_id2color[analysis_method_id], facecolor='w') legend_ls.append(self.analysis_method_id2name[analysis_method_id]) pscatter_ls.append(pscatter) pylab.legend(pscatter_ls, legend_ls, shadow=True) sys.stderr.write("Done.\n") | 7d2fce961a1455fa62f12c44842e84c05fb5b474 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9645/7d2fce961a1455fa62f12c44842e84c05fb5b474/DrawSNPRegion.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
52,
1132,
12,
2890,
16,
4556,
1121,
67,
25850,
67,
2211,
67,
6858,
16,
6285,
67,
2039,
67,
350,
22,
28500,
86,
4672,
3536,
4044,
28,
17,
5908,
17,
3247,
3536,
2589,
18,
11241,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3724,
52,
1132,
12,
2890,
16,
4556,
1121,
67,
25850,
67,
2211,
67,
6858,
16,
6285,
67,
2039,
67,
350,
22,
28500,
86,
4672,
3536,
4044,
28,
17,
5908,
17,
3247,
3536,
2589,
18,
11241,
... |
if action.name.model == action.filter_id.model_id: | if action.model_id.model == action.filter_id.model_id: | def do_check(self, cr, uid, action, obj, context={}): """ check Action @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, @param context: A standard dictionary for contextual values """ ok = True if action.filter_id: if action.name.model == action.filter_id.model_id: context.update(eval(action.filter_id.context)) obj_ids = obj._table.search(cr, uid, eval(action.filter_id.domain), context=context) if not obj.id in obj_ids: ok = False else: ok = False if hasattr(obj, 'user_id'): ok = ok and (not action.trg_user_id.id or action.trg_user_id.id==obj.user_id.id) if hasattr(obj, 'partner_id'): ok = ok and (not action.trg_partner_id.id or action.trg_partner_id.id==obj.partner_id.id) ok = ok and ( not action.trg_partner_categ_id.id or ( obj.partner_id.id and (action.trg_partner_categ_id.id in map(lambda x: x.id, obj.partner_id.category_id or [])) ) ) state_to = context.get('state_to', False) if hasattr(obj, 'state'): ok = ok and (not action.trg_state_from or action.trg_state_from==obj.state) if state_to: ok = ok and (not action.trg_state_to or action.trg_state_to==state_to) elif action.trg_state_to: ok = False reg_name = action.regex_name result_name = True if reg_name: ptrn = re.compile(str(reg_name)) _result = ptrn.search(str(obj.name)) if not _result: result_name = False regex_n = not reg_name or result_name ok = ok and regex_n return ok | 1d07f4092b58310420993921b0ddeb3ac65bb096 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/1d07f4092b58310420993921b0ddeb3ac65bb096/base_action_rule.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1893,
12,
2890,
16,
4422,
16,
4555,
16,
1301,
16,
1081,
16,
819,
12938,
4672,
3536,
866,
4382,
632,
891,
365,
30,
1021,
733,
4407,
632,
891,
4422,
30,
326,
783,
1027,
16,
62... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
1893,
12,
2890,
16,
4422,
16,
4555,
16,
1301,
16,
1081,
16,
819,
12938,
4672,
3536,
866,
4382,
632,
891,
365,
30,
1021,
733,
4407,
632,
891,
4422,
30,
326,
783,
1027,
16,
62... |
9776 (2004). | 9776 (2004). | def rotate_vectors(v1i, v2i, angle): """Rotate vectors *v1i* and *v2i* by *angle*""" cAng = cos(angle) sAng = sin(angle) v1o = v1i * cAng + v2i * sAng v2o = v2i * cAng - v1i * sAng # Ensure the length of the input and output vectors is equal return normalize(v1o) * norm(v1i), normalize(v2o) * norm(v2i) | 4018acf8c674e0693794b02621baa8897f571068 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1380/4018acf8c674e0693794b02621baa8897f571068/dimer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8534,
67,
18535,
12,
90,
21,
77,
16,
331,
22,
77,
16,
5291,
4672,
3536,
16357,
10046,
380,
90,
21,
77,
14,
471,
380,
90,
22,
77,
14,
635,
380,
4341,
14,
8395,
276,
22757,
273,
4987... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8534,
67,
18535,
12,
90,
21,
77,
16,
331,
22,
77,
16,
5291,
4672,
3536,
16357,
10046,
380,
90,
21,
77,
14,
471,
380,
90,
22,
77,
14,
635,
380,
4341,
14,
8395,
276,
22757,
273,
4987... |
ce = self.companion.designer.showCollectionEditor(self.companion.name, | ce = self.companion.designer.showCollectionEditor(self.companion.name, | def edit(self, event): ce = self.companion.designer.showCollectionEditor(self.companion.name, self.name, false) growableRows, growableCols = ce.companion.getGrowables() fgsCompn = ce.companion.parentCompanion numRows = self.companion.eval(fgsCompn.textConstr.params['rows']) numCols = self.companion.eval(fgsCompn.textConstr.params['cols']) if not numRows and not numCols: wxLogError('Rows and Cols may not both be 0') return | 6855cdd6e993138a31fabc262e2e332cdd94b9fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/6855cdd6e993138a31fabc262e2e332cdd94b9fc/SizerCompanions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3874,
12,
2890,
16,
871,
4672,
5898,
273,
365,
18,
2919,
304,
285,
18,
16934,
264,
18,
4500,
2532,
6946,
12,
2890,
18,
2919,
304,
285,
18,
529,
16,
365,
18,
529,
16,
629,
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,
3874,
12,
2890,
16,
871,
4672,
5898,
273,
365,
18,
2919,
304,
285,
18,
16934,
264,
18,
4500,
2532,
6946,
12,
2890,
18,
2919,
304,
285,
18,
529,
16,
365,
18,
529,
16,
629,
13,
225,
... |
print outline[linenum],enum | if enum != 1: return v["%l"] = str(outline[linenum][1]) v["%n"] = str(linenum) v["%c"] = str(enum) list = getBlock(linenum,'<') print subVars("UserPrefText","before") lines = "" for line in list: if line == "": lines = lines + config.get("UserPrefText","paragraph-sep") else: lines = lines + line + config.get("UserPrefText","line-sep") v["%%"] = strip(lines) print subVars("UserPrefText","text"), print subVars("UserPrefText","after") def isAlignRight(col): l = len(col) if (col[0:2] == " ") and (col[l-2:l] != " "): return 1 else: return 0 def isAlignLeft(col): l = len(col) if (col[0:2] != " ") and (col[l-2:l] == " "): return 1 else: return 0 def isAlignCenter(col): l = len(col) if (col[0:2] == " ") and (col[l-2:l] == " "): return 1 else: return 0 def handleHeaderRow(row): global outline, parents row = lstrip(rstrip(row,"|"),"|") columns = row.split("|") print subVars("Tables","before-table-header") for col in columns: v["%%"] = strip(col) if isAlignCenter: print subVars("Tables","table-header-column-center") elif isAlignCenter: print subVars("Tables","table-header-column-center") elif isAlignCenter: print subVars("Tables","table-header-column-center") else: print subVars("Tables","table-header-column") print subVars("Tables","after-table-header") def handleRow(row): global outline, parents if row[0:2] == "||": handleHeaderRow(row) return row = lstrip(rstrip(row,"|"),"|") columns = row.split("|") print subVars("Tables","before-table-row") for col in columns: v["%%"] = strip(col) if isAlignCenter: print subVars("Tables","table-column-center") elif isAlignLeft: print subVars("Tables","table-column-left") elif isAlignRight: print subVars("Tables","table-column-right") else: print subVars("Tables","table-column") print subVars("Tables","after-table-row") | def handleUserPrefText(linenum,enum): global outline, parents # just a place keeper print outline[linenum],enum | 06415efd07e1e7445f08ac0ea608650310478422 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6154/06415efd07e1e7445f08ac0ea608650310478422/otl2tags.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1640,
1299,
23218,
1528,
12,
7511,
7924,
16,
7924,
4672,
2552,
16363,
16,
6298,
468,
2537,
279,
3166,
417,
9868,
309,
2792,
480,
404,
30,
327,
225,
331,
9614,
9,
80,
11929,
273,
609,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1299,
23218,
1528,
12,
7511,
7924,
16,
7924,
4672,
2552,
16363,
16,
6298,
468,
2537,
279,
3166,
417,
9868,
309,
2792,
480,
404,
30,
327,
225,
331,
9614,
9,
80,
11929,
273,
609,
1... |
msg = email.message_from_file(fp) | msg = email.message_from_file(fp, strict=strict) | def _msgobj(self, filename): fp = openfile(findfile(filename)) try: msg = email.message_from_file(fp) finally: fp.close() return msg | 825154870b11bdae0cd2b37ef150eaa3dfe363e2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/825154870b11bdae0cd2b37ef150eaa3dfe363e2/test_email.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3576,
2603,
12,
2890,
16,
1544,
4672,
4253,
273,
1696,
768,
12,
4720,
768,
12,
3459,
3719,
775,
30,
1234,
273,
2699,
18,
2150,
67,
2080,
67,
768,
12,
7944,
16,
5490,
33,
13948,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3576,
2603,
12,
2890,
16,
1544,
4672,
4253,
273,
1696,
768,
12,
4720,
768,
12,
3459,
3719,
775,
30,
1234,
273,
2699,
18,
2150,
67,
2080,
67,
768,
12,
7944,
16,
5490,
33,
13948,
... |
conf = self.read_lists_config(configfile) updater = Updater(conf) self.read_changesets(config['infobase_log_url'], updater.process_changesets) def read_lists_config(self, configfile): | def run(self, configfile, offset_file): self.offset_file = offset_file conf = self.read_lists_config(configfile) updater = Updater(conf) self.read_changesets(config['infobase_log_url'], updater.process_changesets) | 8e8c09448d02e28b7e360ded35c899a8f846309a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/8e8c09448d02e28b7e360ded35c899a8f846309a/manage-lists.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
642,
768,
16,
1384,
67,
768,
4672,
365,
18,
3348,
67,
768,
273,
1384,
67,
768,
2195,
273,
365,
18,
896,
67,
9772,
67,
1425,
12,
1425,
768,
13,
225,
7760,
273,
2... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
16,
642,
768,
16,
1384,
67,
768,
4672,
365,
18,
3348,
67,
768,
273,
1384,
67,
768,
2195,
273,
365,
18,
896,
67,
9772,
67,
1425,
12,
1425,
768,
13,
225,
7760,
273,
2... | |
self._content = '' | self._content = u'' | def __init__(self): """Initialise instance variables.""" self._content = '' self.paths = [] self.msg = '' self.author = '' self.date = '' self.revision = '' self.is_msg = False self.is_author = False self.is_date = False self.is_path = False ContentHandler.__init__(self) | be2976e66a12ae1668007813c2bfe7c4b375aa89 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4674/be2976e66a12ae1668007813c2bfe7c4b375aa89/svnlogatom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3536,
4435,
784,
791,
3152,
12123,
365,
6315,
1745,
273,
582,
6309,
365,
18,
4481,
273,
5378,
365,
18,
3576,
273,
875,
365,
18,
4161,
273,
875,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
3536,
4435,
784,
791,
3152,
12123,
365,
6315,
1745,
273,
582,
6309,
365,
18,
4481,
273,
5378,
365,
18,
3576,
273,
875,
365,
18,
4161,
273,
875,
365,
18... |
filename in self.installed_file_conflicts[pkg1]: | (filename,pkg2) in self.installed_file_conflicts[pkg1]: | def _hasFileConflict(self, pkg1, pkg2, filename, pkg1_fi, operation=OP_INSTALL): if self.config.checkinstalled == 0 and \ pkg1 in self.installed_file_conflicts and \ filename in self.installed_file_conflicts[pkg1]: return 0 if operation == OP_UPDATE and \ (pkg2 in self.pkg_updates or pkg2 in self.pkg_obsoletes): return 0 if operation == OP_UPDATE: if pkg1["name"] == pkg2["name"]: return 0 else: if pkg1.getNEVR() == pkg2.getNEVR() and \ buildarchtranslate[pkg1["arch"]] != \ buildarchtranslate[pkg2["arch"]] and \ pkg1["arch"] != "noarch" and \ pkg2["arch"] != "noarch": # do not check packages with the same NEVR which are # not buildarchtranslate compatible return 0 fi = pkg2.getRpmFileInfo(filename) # ignore directories if S_ISDIR(pkg1_fi.mode) and S_ISDIR(fi.mode): return 0 # ignore links if S_ISLNK(pkg1_fi.mode) and S_ISLNK(fi.mode): return 0 # ignore identical files if pkg1_fi.mode == fi.mode and \ pkg1_fi.filesize == fi.filesize and \ pkg1_fi.md5sum == fi.md5sum: return 0 # ignore ghost files if pkg1_fi.flags & base.RPMFILE_GHOST or \ fi.flags & base.RPMFILE_GHOST: return 0 | fccf79fa04d60b3463abaf4b62e8b9794391d8af /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/fccf79fa04d60b3463abaf4b62e8b9794391d8af/resolver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5332,
812,
10732,
12,
2890,
16,
3475,
21,
16,
3475,
22,
16,
1544,
16,
3475,
21,
67,
22056,
16,
1674,
33,
3665,
67,
28865,
4672,
309,
365,
18,
1425,
18,
1893,
13435,
422,
374,
47... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5332,
812,
10732,
12,
2890,
16,
3475,
21,
16,
3475,
22,
16,
1544,
16,
3475,
21,
67,
22056,
16,
1674,
33,
3665,
67,
28865,
4672,
309,
365,
18,
1425,
18,
1893,
13435,
422,
374,
47... |
if not 'MATHLIB' in os.environ: | if not os.environ.has_key('MATHLIB'): | def config_toplevel(self): print " ============= begin top level configuration =============" | bbfab57135c981d6ff6f4a633fd0e00d94e09de6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/bbfab57135c981d6ff6f4a633fd0e00d94e09de6/setup_xplt.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
642,
67,
3669,
2815,
12,
2890,
4672,
1172,
315,
225,
422,
1432,
12275,
2376,
1760,
1801,
1664,
422,
1432,
631,
1546,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
642,
67,
3669,
2815,
12,
2890,
4672,
1172,
315,
225,
422,
1432,
12275,
2376,
1760,
1801,
1664,
422,
1432,
631,
1546,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self._previous_pwLeftAreaWidth = PM_DEFAULT_WIDTH | def __init__(self, assy, parent): """ Constructor for the part window. | 768028589b20c831bb59b141074536c76c7b2736 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/768028589b20c831bb59b141074536c76c7b2736/Ui_PartWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1551,
93,
16,
982,
4672,
3536,
11417,
364,
326,
1087,
2742,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1551,
93,
16,
982,
4672,
3536,
11417,
364,
326,
1087,
2742,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... | |
if isdigest: print >> self._fp | def _handle_multipart(self, msg, isdigest=0): # The trick here is to write out each part separately, merge them all # together, and then make sure that the boundary we've chosen isn't # present in the payload. msgtexts = [] subparts = msg.get_payload() if subparts is None: # Nothing has every been attached boundary = msg.get_boundary(failobj=_make_boundary()) print >> self._fp, '--' + boundary print >> self._fp, '\n' print >> self._fp, '--' + boundary + '--' return elif not isinstance(subparts, ListType): # Scalar payload subparts = [subparts] for part in subparts: s = StringIO() g = self.__class__(s, self._mangle_from_, self.__maxheaderlen) g.flatten(part, unixfrom=0) msgtexts.append(s.getvalue()) # Now make sure the boundary we've selected doesn't appear in any of # the message texts. alltext = NL.join(msgtexts) # BAW: What about boundaries that are wrapped in double-quotes? boundary = msg.get_boundary(failobj=_make_boundary(alltext)) # If we had to calculate a new boundary because the body text # contained that string, set the new boundary. We don't do it # unconditionally because, while set_boundary() preserves order, it # doesn't preserve newlines/continuations in headers. This is no big # deal in practice, but turns out to be inconvenient for the unittest # suite. if msg.get_boundary() <> boundary: msg.set_boundary(boundary) # Write out any preamble if msg.preamble is not None: self._fp.write(msg.preamble) # First boundary is a bit different; it doesn't have a leading extra # newline. print >> self._fp, '--' + boundary if isdigest: print >> self._fp # Join and write the individual parts joiner = '\n--' + boundary + '\n' if isdigest: # multipart/digest types effectively add an extra newline between # the boundary and the body part. joiner += '\n' self._fp.write(joiner.join(msgtexts)) print >> self._fp, '\n--' + boundary + '--', # Write out any epilogue if msg.epilogue is not None: if not msg.epilogue.startswith('\n'): print >> self._fp self._fp.write(msg.epilogue) | 93c40f0c3a9e96f46e51d92c3bfa8ac50012902b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/93c40f0c3a9e96f46e51d92c3bfa8ac50012902b/Generator.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
16404,
12,
2890,
16,
1234,
16,
353,
10171,
33,
20,
4672,
468,
1021,
28837,
2674,
353,
358,
1045,
596,
1517,
1087,
18190,
16,
2691,
2182,
777,
468,
9475,
16,
471,
1508,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
67,
16404,
12,
2890,
16,
1234,
16,
353,
10171,
33,
20,
4672,
468,
1021,
28837,
2674,
353,
358,
1045,
596,
1517,
1087,
18190,
16,
2691,
2182,
777,
468,
9475,
16,
471,
1508,
1... | |
h_macaddresses = ComputerManager().getMachineMac(ctx, {'uuids':uuids}) macaddresses = h_macaddresses.values() if not len(uuids): logger.info("There is no computers in the profile %s"%profileUUID) ret = 1 else: | if len(uuids): h_macaddresses = ComputerManager().getMachineMac(ctx, {'uuids':uuids}) macaddresses = h_macaddresses.values() | def checkProfileForImaging(self, profileUUID): """ @return: 0 if the profile can be registered into the imaging module @rtype: int """ logger = logging.getLogger() ret = 0 ctx = self.currentContext uuids = map(lambda c: c.uuid, ComputerProfileManager().getProfileContent(profileUUID)) h_macaddresses = ComputerManager().getMachineMac(ctx, {'uuids':uuids}) macaddresses = h_macaddresses.values() if not len(uuids): # No computer in profile logger.info("There is no computers in the profile %s"%profileUUID) ret = 1 else: if [''] in macaddresses: # Some computers don't have a MAC address logger.info("Some computers don't have any MAC address in the profile %s"%(profileUUID)) ret = 2 elif len(uuids) < len(macaddresses): # Some computers have more than one MAC address logger.info("Some computers have more than one MAC address in the profile %s"%(profileUUID)) ret = 3 elif len(uuids) > len(macaddresses): # Some computers don't have a MAC address list_of_fail = uuids for uuid in h_macaddresses.keys(): if uuid in list_of_fail: list_of_fail.remove(uuid) logger.info("Some computers don't have any MAC address in the profile %s (%s)"%(profileUUID, str(list_of_fail))) ret = 2 else: ret = 0 # Check all MAC addresses i = 0 for macaddress in macaddresses: if not pulse2.utils.isLinuxMacAddress(macaddress[0]): logger.info("The computer %s don't have a valid MAC address"%uuids[i]) ret = 4 break i+=1 if not ret: # Still no error ? Now checks that all the computers belong to the # same entity locations = ComputerLocationManager().getMachinesLocations(uuids) try: locations_uuid = map(lambda l: l['uuid'], locations.values()) except IndexError: locations_uuid = [] if len(locations_uuid) != len(uuids): # some computers have no location ? logger.info("Some computers don't have location in the profile %s"%(profileUUID)) ret = 5 elif locations_uuid.count(locations_uuid[0]) != len(locations_uuid): # All the computers don't belong to the same location logger.info("All the computers don't belong to the same location (%s)"%(profileUUID)) ret = 6 return ret | ec0e217b7892f5164faf5f0e553fe71aed950aac /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/ec0e217b7892f5164faf5f0e553fe71aed950aac/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
4029,
1290,
1170,
5755,
12,
2890,
16,
3042,
5562,
4672,
3536,
632,
2463,
30,
374,
309,
326,
3042,
848,
506,
4104,
1368,
326,
709,
5755,
1605,
632,
86,
723,
30,
509,
3536,
1194,
27... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
4029,
1290,
1170,
5755,
12,
2890,
16,
3042,
5562,
4672,
3536,
632,
2463,
30,
374,
309,
326,
3042,
848,
506,
4104,
1368,
326,
709,
5755,
1605,
632,
86,
723,
30,
509,
3536,
1194,
27... |
archs=RebuilddConfig().get('build', 'archs').split(' '), \ | archs=RebuilddConfig().arch, \ | def GET(self, jobid=None): job = Job.selectBy(id=jobid)[0] | 500a29fd72ab479c197319edd219621978c64719 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5334/500a29fd72ab479c197319edd219621978c64719/RebuilddHTTPServer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4978,
12,
2890,
16,
1719,
350,
33,
7036,
4672,
1719,
273,
3956,
18,
4025,
858,
12,
350,
33,
4688,
350,
25146,
20,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4978,
12,
2890,
16,
1719,
350,
33,
7036,
4672,
1719,
273,
3956,
18,
4025,
858,
12,
350,
33,
4688,
350,
25146,
20,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
COMMAND = "pdftotext -enc Latin1 %(input)s %(output)s" OUTPUT_TYPE = 'text' | COMMAND = "pdftohtml -i -q -noframes -stdout -enc UTF-8 %(input)s > %(output)s" OUTPUT_TYPE = 'html' | def extractWordsFromFile(self, filename): outputDir = mkdtemp() outputFile = os.path.join(outputDir, 'out.txt') command_args = {'input' : filename, 'output' : outputFile} cmd = self.COMMAND % command_args print "Executing %r" % cmd errcode = os.system(cmd) try: if errcode == 0: # OK parser = self.getParser() return parser.parseFile(outputFile, self.OUTPUT_ENCODING) else: raise IndexationFailure('Unable to index %r' % filename) finally: if os.path.isfile(outputFile): os.remove(outputFile) os.rmdir(outputDir) | d6147f50e21a179db930d713fe8d62df8ec10b5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2259/d6147f50e21a179db930d713fe8d62df8ec10b5a/converter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2608,
7363,
13087,
12,
2890,
16,
1544,
4672,
21412,
273,
31381,
5814,
1435,
15047,
273,
1140,
18,
803,
18,
5701,
12,
2844,
1621,
16,
296,
659,
18,
5830,
6134,
1296,
67,
1968,
273,
13666,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7363,
13087,
12,
2890,
16,
1544,
4672,
21412,
273,
31381,
5814,
1435,
15047,
273,
1140,
18,
803,
18,
5701,
12,
2844,
1621,
16,
296,
659,
18,
5830,
6134,
1296,
67,
1968,
273,
13666,... |
self.tabCols.trace_variable('w',self.VarChanged_tabCols) | def AttachVarCallbacks(self): self.fontSize.trace_variable('w',self.VarChanged_fontSize) self.fontName.trace_variable('w',self.VarChanged_fontName) self.fontBold.trace_variable('w',self.VarChanged_fontBold) self.spaceNum.trace_variable('w',self.VarChanged_spaceNum) self.tabCols.trace_variable('w',self.VarChanged_tabCols) self.indentBySpaces.trace_variable('w',self.VarChanged_indentBySpaces) self.colour.trace_variable('w',self.VarChanged_colour) self.builtinTheme.trace_variable('w',self.VarChanged_builtinTheme) self.customTheme.trace_variable('w',self.VarChanged_customTheme) self.themeIsBuiltin.trace_variable('w',self.VarChanged_themeIsBuiltin) self.highlightTarget.trace_variable('w',self.VarChanged_highlightTarget) self.keyBinding.trace_variable('w',self.VarChanged_keyBinding) self.builtinKeys.trace_variable('w',self.VarChanged_builtinKeys) self.customKeys.trace_variable('w',self.VarChanged_customKeys) self.keysAreBuiltin.trace_variable('w',self.VarChanged_keysAreBuiltin) self.winWidth.trace_variable('w',self.VarChanged_winWidth) self.winHeight.trace_variable('w',self.VarChanged_winHeight) self.startupEdit.trace_variable('w',self.VarChanged_startupEdit) | efd6a44d9a375222b7d4e24e520f2c3beb6be817 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/efd6a44d9a375222b7d4e24e520f2c3beb6be817/configDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8659,
1537,
10617,
12,
2890,
4672,
365,
18,
5776,
1225,
18,
5129,
67,
6105,
2668,
91,
2187,
2890,
18,
1537,
5033,
67,
5776,
1225,
13,
365,
18,
5776,
461,
18,
5129,
67,
6105,
2668,
91,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8659,
1537,
10617,
12,
2890,
4672,
365,
18,
5776,
1225,
18,
5129,
67,
6105,
2668,
91,
2187,
2890,
18,
1537,
5033,
67,
5776,
1225,
13,
365,
18,
5776,
461,
18,
5129,
67,
6105,
2668,
91,
... | |
msgid = e.msgid | msgid = self._encode(e.msgid) | def cmp(_self, other): if _self.msgid > other.msgid: return 1 elif _self.msgid < other.msgid: return -1 else: return 0 | cdea390b7214d8a3b58120248b62da616fc51152 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9209/cdea390b7214d8a3b58120248b62da616fc51152/polib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9411,
24899,
2890,
16,
1308,
4672,
309,
389,
2890,
18,
3576,
350,
405,
1308,
18,
3576,
350,
30,
327,
404,
1327,
389,
2890,
18,
3576,
350,
411,
1308,
18,
3576,
350,
30,
327,
300,
21,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9411,
24899,
2890,
16,
1308,
4672,
309,
389,
2890,
18,
3576,
350,
405,
1308,
18,
3576,
350,
30,
327,
404,
1327,
389,
2890,
18,
3576,
350,
411,
1308,
18,
3576,
350,
30,
327,
300,
21,
... |
try: body = [output, extra] except NameError: body = [output] | body = [output] | def perform_modifyfield(colID, fldID, fldvID='', ln=cdslang, content='', callback='yes', confirm=0): """Modify the fieldvalues for a field""" colID = int(colID) col_dict = dict(get_def_name('', "collection")) fld_dict = dict(get_def_name('', "field")) fld_type = get_sort_nametypes() fldID = int(fldID) subtitle = """<a name="7.3">Modify values for field '%s'</a>""" % (fld_dict[fldID]) output = """<dl> <dt>Value specific actions <dd><a href="addexistingfieldvalue?colID=%s&ln=%s&fldID=%s#7.4">Add existing value to search option</a></dd> <dd><a href="addnewfieldvalue?colID=%s&ln=%s&fldID=%s#7.4">Add new value to search option</a></dd> <dd><a href="rearrangefieldvalue?colID=%s&ln=%s&fldID=%s#7.4">Order values alphabetically</a></dd> </dl> """ % (colID, ln, fldID, colID, ln, fldID, colID, ln, fldID) header = ['', 'Value name', 'Actions'] actions = [] cdslang = get_languages() lang = dict(cdslang) fld_type_list = fld_type.items() col_fld = list(get_col_fld(colID, 'seo', fldID)) if len(col_fld) == 1 and col_fld[0][1] is None: output += """<b><span class="info">No values added for this search option yet</span></b>""" else: j = 0 for (fldID, fldvID, stype, score, score_fieldvalue) in col_fld: fieldvalue = get_fld_value(fldvID) move = "" if j != 0: move += """<a href="%s/admin/websearch/websearchadmin.py/switchfldvaluescore?colID=%s&ln=%s&id_1=%s&id_fldvalue_1=%s&id_fldvalue_2=%s&rand=%s#7.3"><img border="0" src="%s/img/smallup.gif" title="Move up"></a>""" % (weburl, colID, ln, fldID, fldvID, col_fld[j - 1][1], random.randint(0, 1000), weburl) else: move += " " j += 1 if j != len(col_fld): move += """<a href="%s/admin/websearch/websearchadmin.py/switchfldvaluescore?colID=%s&ln=%s&id_1=%s&id_fldvalue_1=%s&id_fldvalue_2=%s&rand=%s#7.3"><img border="0" src="%s/img/smalldown.gif" title="Move down"></a>""" % (weburl, colID, ln, fldID, fldvID, col_fld[j][1], random.randint(0, 1000), weburl) if fieldvalue[0][1] != fieldvalue[0][2] and fldvID is not None: actions.append([move, "%s - %s" % (fieldvalue[0][1], fieldvalue[0][2])]) elif fldvID is not None: actions.append([move, "%s" % fieldvalue[0][1]]) move = '' for col in [(('Modify value', 'modifyfieldvalue'), ('Remove value', 'removefieldvalue'),)]: actions[-1].append('<a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&ln=%s&fldID=%s&fldvID=%s&fmeth=seo#7.4">%s</a>' % (weburl, col[0][1], colID, ln, fldID, fldvID, col[0][0])) for (str, function) in col[1:]: actions[-1][-1] += ' / <a href="%s/admin/websearch/websearchadmin.py/%s?colID=%s&ln=%s&fldID=%s&fldvID=%s#7.4">%s</a>' % (weburl, function, colID, ln, fldID, fldvID, str) output += tupletotable(header=header, tuple=actions) output += content try: body = [output, extra] except NameError: body = [output] output = "<br>" + addadminbox(subtitle, body) if len(col_fld) == 0: output = content return perform_showsearchoptions(colID, ln, content=output) | fb83561e15cf55d482f8b6090f9c163f4f103bae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2139/fb83561e15cf55d482f8b6090f9c163f4f103bae/websearchadminlib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
1518,
12,
1293,
734,
16,
9880,
734,
16,
9880,
90,
734,
2218,
2187,
7211,
33,
4315,
2069,
539,
16,
913,
2218,
2187,
1348,
2218,
9707,
2187,
6932,
33,
20,
4672,
3536,
11... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3073,
67,
17042,
1518,
12,
1293,
734,
16,
9880,
734,
16,
9880,
90,
734,
2218,
2187,
7211,
33,
4315,
2069,
539,
16,
913,
2218,
2187,
1348,
2218,
9707,
2187,
6932,
33,
20,
4672,
3536,
11... |
Id: 11 | Id: 12 | def exercise_modifiers(verbose=0): if (verbose): out = sys.stdout mtz_object = mtz.object() mtz_object.set_title(title="012345678") assert mtz_object.title() == "012345678" mtz_object.set_title(title="012345678", append=True) assert mtz_object.title() == "012345678 012345678" mtz_object.set_title(title="0123456789"*10+"012345678", append=True) assert mtz_object.title() == "012345678 "*2 + "0123456789"*5 mtz_object.set_title("0123456789"*100) assert mtz_object.title() == "0123456789"*7 mtz_object.add_history(lines=flex.std_string(["a1", "a2"])) assert list(mtz_object.history()) == ["a1", "a2"] mtz_object.add_history(lines=flex.std_string(["b1", "b2"])) assert list(mtz_object.history()) == ["b1", "b2", "a1", "a2"] mtz_object.add_history(line="c1") assert list(mtz_object.history()) == ["c1", "b1", "b2", "a1", "a2"] mtz_object.set_space_group_name(name="sg"*100) assert mtz_object.space_group_name() == "sgsgsgsgsgsgsgsgsgsg" mtz_object.set_space_group_number(number=12) assert mtz_object.space_group_number() == 12 mtz_object.set_point_group_name(name="pg"*100) assert mtz_object.point_group_name() == "pgpgpgpgpg" mtz_object.set_lattice_centring_type(symbol="C") assert mtz_object.lattice_centring_type() == "C" for space_group_symbols in sgtbx.space_group_symbol_iterator(): space_group = sgtbx.space_group(space_group_symbols) mtz_object.set_space_group(space_group) assert mtz_object.space_group() == space_group assert mtz_object.n_symmetry_matrices() == space_group.order_z() mtz_object = mtz.object() \ .set_title(title="exercise") \ .add_history(lines=flex.std_string(["h2"])) \ .add_history(line="h1") \ .set_space_group_name("sg") \ .set_space_group_number(123) \ .set_point_group_name("pg") \ .set_space_group(sgtbx.space_group_info(number=123).group()) assert mtz_object.title() == "exercise" assert list(mtz_object.history()) == ["h1", "h2"] for stage in [0,1]: for i_crystal in xrange(3): if (stage == 0): if (i_crystal % 2 == 0): crystal = mtz_object.add_crystal( name="crystal_%d"%i_crystal, project_name="project_%d"%i_crystal, unit_cell_parameters=(10+i_crystal,20,20,90,90,120)) else: crystal = mtz_object.add_crystal( name="crystal_%d"%i_crystal, project_name="project_%d"%i_crystal, unit_cell=uctbx.unit_cell((10+i_crystal,20,20,90,90,120))) else: crystal = mtz_object.crystals()[i_crystal] assert crystal.i_crystal() == i_crystal assert crystal.name() == "crystal_%d"%i_crystal assert crystal.project_name() == "project_%d"%i_crystal assert approx_equal(crystal.unit_cell_parameters(), (10+i_crystal,20,20,90,90,120)) if (not verbose): out = StringIO() mtz_object.show_summary(out=out) if (not verbose): assert out.getvalue() == """\ | c3cf0722281a181a283d00bb69ac8271125a2ef3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/c3cf0722281a181a283d00bb69ac8271125a2ef3/tst_ext.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24165,
67,
15432,
12,
11369,
33,
20,
4672,
309,
261,
11369,
4672,
596,
273,
2589,
18,
10283,
5874,
94,
67,
1612,
273,
5874,
94,
18,
1612,
1435,
5874,
94,
67,
1612,
18,
542,
67,
2649,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
24165,
67,
15432,
12,
11369,
33,
20,
4672,
309,
261,
11369,
4672,
596,
273,
2589,
18,
10283,
5874,
94,
67,
1612,
273,
5874,
94,
18,
1612,
1435,
5874,
94,
67,
1612,
18,
542,
67,
2649,
... |
format = format.replace('yy', sYear[1:3]) | format = format.replace('yy', sYear[2:4]) | def format(self, format, locale='*'): """ Convert the date to a string as specified by the format argument. @param format: The following directives can be embedded in the format string:: -yyyy four digit year -yy two digit year -month full month -mmm short month -mm month as a decimal number -dd day of the month as a decimal number -day full week day -ddd short week day -h24 24-based hours -h12 12-based hours -min minutes -sec seconds -MM locale's AM or PM @type format: str @param locale: The locale string. If ommited the '*' is used. @type locale: str @return: The formatted string @rtype: str """ tupTime = time.localtime(self.value) sYear = str(tupTime[0]) iMonth = tupTime[1]-1 iDate = tupTime[2] iHours = tupTime[3] if iHours>12: iHours12 = iHours - 12 ampm = resources.getResource('PM', locale) else: iHours12 = iHours ampm = resources.getResource('AM', locale) iMins = tupTime[4] iSecs = tupTime[5] iWeekday = tupTime[6] | 7ade9bfd11b44bb62d945def1fcb1c652c958aa2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2504/7ade9bfd11b44bb62d945def1fcb1c652c958aa2/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
740,
16,
2573,
2218,
4035,
4672,
3536,
4037,
326,
1509,
358,
279,
533,
487,
1269,
635,
326,
740,
1237,
18,
225,
632,
891,
740,
30,
1021,
3751,
13877,
848,
506,
7488,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
740,
12,
2890,
16,
740,
16,
2573,
2218,
4035,
4672,
3536,
4037,
326,
1509,
358,
279,
533,
487,
1269,
635,
326,
740,
1237,
18,
225,
632,
891,
740,
30,
1021,
3751,
13877,
848,
506,
7488,... |
source_dir = libtbx.path.norm_join(libtbx.env.build_path, sub_dir) | source_dir = libtbx.env.under_build(sub_dir) | def run(target_root): cwd = os.getcwd() abs_target_root = os.path.normpath(os.path.abspath(target_root)) for sub_dir,visitor in (("lib", copy_lib_and_exe_files), ("exe", copy_lib_and_exe_files), ("python", copy_python_files)): source_dir = libtbx.path.norm_join(libtbx.env.build_path, sub_dir) if (os.path.isdir(source_dir)): target_dir = libtbx.path.norm_join(abs_target_root, sub_dir) os.chdir(source_dir) os.path.walk(".", visitor, target_dir) libtbx.bundle.utils.write_bundle_info(abs_target_root, write_build_options=True) os.chdir(cwd) | 10ed261711faf74fc3e15437dfbd62371ec7d550 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/696/10ed261711faf74fc3e15437dfbd62371ec7d550/copy_build_libtbx.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
3299,
67,
3085,
4672,
7239,
273,
1140,
18,
588,
11089,
1435,
2417,
67,
3299,
67,
3085,
273,
1140,
18,
803,
18,
7959,
803,
12,
538,
18,
803,
18,
5113,
803,
12,
3299,
67,
308... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3299,
67,
3085,
4672,
7239,
273,
1140,
18,
588,
11089,
1435,
2417,
67,
3299,
67,
3085,
273,
1140,
18,
803,
18,
7959,
803,
12,
538,
18,
803,
18,
5113,
803,
12,
3299,
67,
308... |
records = list(SeqIO.parse(handle=open(t_filename,"r"), format=t_format)) | records = list(SeqIO.parse(handle=open(t_filename,mode), format=t_format)) | def check_simple_write_read(records, indent=" "): #print indent+"Checking we can write and then read back these records" for format in test_write_read_alignment_formats: if format not in possible_unknown_seq_formats \ and isinstance(records[0].seq, UnknownSeq) \ and len(records[0].seq) > 100: #Skipping for speed. Some of the unknown sequences are #rather long, and it seems a bit pointless to record them. continue print indent+"Checking can write/read as '%s' format" % format #Going to write to a handle... handle = StringIO() try: c = SeqIO.write(sequences=records, handle=handle, format=format) assert c == len(records) except (TypeError, ValueError), e: #This is often expected to happen, for example when we try and #write sequences of different lengths to an alignment file. if "len()" in str(e): #Python 2.4.3, #>>> len(None) #... #TypeError: len() of unsized object # #Python 2.5.2, #>>> len(None) #... #TypeError: object of type 'NoneType' has no len() print "Failed: Probably len() of None" else: print indent+"Failed: %s" % str(e) assert format != t_format, \ "Should be able to re-write in the original format!" #Carry on to the next format: continue handle.flush() handle.seek(0) #Now ready to read back from the handle... try: records2 = list(SeqIO.parse(handle=handle, format=format)) except ValueError, e: #This is BAD. We can't read our own output. #I want to see the output when called from the test harness, #run_tests.py (which can be funny about new lines on Windows) handle.seek(0) raise ValueError("%s\n\n%s\n\n%s" \ % (str(e), repr(handle.read()), repr(records))) assert len(records2) == t_count for r1, r2 in zip(records, records2): #Check the bare minimum (ID and sequence) as #many formats can't store more than that. #Check the sequence if format in ["gb", "genbank", "embl"]: #The GenBank/EMBL parsers will convert to upper case. assert r1.seq.tostring().upper() == r2.seq.tostring() elif format == "qual": assert isinstance(r2.seq, UnknownSeq) assert len(r2) == len(r1) else: assert r1.seq.tostring() == r2.seq.tostring() #Beware of different quirks and limitations in the #valid character sets and the identifier lengths! if format=="phylip": assert r1.id.replace("[","").replace("]","")[:10] == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) elif format=="clustal": assert r1.id.replace(" ","_")[:30] == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) elif format=="stockholm": assert r1.id.replace(" ","_") == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) elif format=="fasta": assert r1.id.split()[0] == r2.id else: assert r1.id == r2.id, \ "'%s' vs '%s'" % (r1.id, r2.id) | 3e60a601eafa492cf904cc785d9e486ca5080e08 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/3e60a601eafa492cf904cc785d9e486ca5080e08/test_SeqIO.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9647,
67,
2626,
67,
896,
12,
7094,
16,
3504,
1546,
315,
4672,
468,
1188,
3504,
9078,
14294,
732,
848,
1045,
471,
1508,
855,
1473,
4259,
3853,
6,
364,
740,
316,
1842,
67,
2626,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
9647,
67,
2626,
67,
896,
12,
7094,
16,
3504,
1546,
315,
4672,
468,
1188,
3504,
9078,
14294,
732,
848,
1045,
471,
1508,
855,
1473,
4259,
3853,
6,
364,
740,
316,
1842,
67,
2626,... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.