rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
pos += 1 | def PyUnicode_DecodeRawUnicodeEscape(s, size,errors): if (size == 0): return u'' pos = 0 p = [] while (pos < len(s)): ch = s[pos] #/* Non-escape characters are interpreted as Unicode ordinals */ if (ch != '\\'): p += ch pos += 1 continue startinpos = pos pos += 1 | 5efa14154184eac5ee6ca6162a67c199654ad7fc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/5efa14154184eac5ee6ca6162a67c199654ad7fc/unicodecodec.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4707,
16532,
67,
6615,
4809,
16532,
8448,
12,
87,
16,
963,
16,
4324,
4672,
225,
309,
261,
1467,
422,
374,
4672,
327,
582,
6309,
949,
273,
374,
293,
273,
5378,
1323,
261,
917,
411,
562,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4707,
16532,
67,
6615,
4809,
16532,
8448,
12,
87,
16,
963,
16,
4324,
4672,
225,
309,
261,
1467,
422,
374,
4672,
327,
582,
6309,
949,
273,
374,
293,
273,
5378,
1323,
261,
917,
411,
562,... | |
print 'trying alternate: %s' % alt_fname | _debug_('trying alternate: %s' % alt_fname) | def __getfont__(self, filename, ptsize): ptsize = int(ptsize / 0.7) # XXX pygame multiplies by 0.7 for some reason | 7d3df0cfada32b1835519071e9f53f6a23adcde4 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/7d3df0cfada32b1835519071e9f53f6a23adcde4/osd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
588,
5776,
972,
12,
2890,
16,
1544,
16,
5818,
1467,
4672,
5818,
1467,
273,
509,
12,
1092,
554,
342,
374,
18,
27,
13,
225,
468,
11329,
2395,
13957,
3309,
5259,
635,
374,
18,
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,
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,
588,
5776,
972,
12,
2890,
16,
1544,
16,
5818,
1467,
4672,
5818,
1467,
273,
509,
12,
1092,
554,
342,
374,
18,
27,
13,
225,
468,
11329,
2395,
13957,
3309,
5259,
635,
374,
18,
27,
... |
def run_and_handle_errors(self): try: self.run() except CheckoutNeedsUpdate, e: log("Commit failed because the checkout is out of date. Please update and try again.") log("You can pass --no-build to skip building/testing after update if you believe the new commits did not affect the results.") WorkQueue.exit_after_handled_error(e) except ScriptError, e: self._tool.bugs.reject_patch_from_commit_queue(self._patch["id"], e.message_with_output()) WorkQueue.exit_after_handled_error(e) def update(self): self._tool.scm().update_webkit() def apply_patch(self): log("Processing patch %s from bug %s." % (self._patch["id"], self._patch["bug_id"])) self._tool.scm().apply_patch(self._patch, force=self._options.non_interactive) def build(self): WebKitLandingScripts.ensure_builders_are_green(self._tool.buildbot, self._options) WebKitLandingScripts.build_webkit(quiet=self._options.quiet, port=self._port) def test(self): WebKitScripts.run_webkit_tests(launch_safari=not options.non_interactive, fail_fast=options.non_interactive, quiet=options.quiet, port=port) def commit(self): commit_message = commit_message_for_this_commit(self._tool.scm()) return self._tool.scm().commit_with_message(commit_message.message()) def close_patch(self, commit_log): comment_text = bug_comment_from_commit_text(self._tool.scm(), commit_log) self._tool.bugs.clear_attachment_flags(self._patch["id"], comment_text) def close_bug(self): patches = self._tool.bugs.fetch_patches_from_bug(self._patch["bug_id"]) for patch in patches: review_flag = patch.get("review") if review_flag == "?" or review_flag == "+": log("Not closing bug %s as attachment %s has review=%s. Assuming there are more patches to land from this bug." % (patch["bug_id"], patch["id"], review_flag)) return self._tool.bugs.close_bug_as_fixed(self._patch["bug_id"], "All reviewed patches have been landed. Closing bug.") | return CommitMessage("".join(changelog_messages).splitlines()) | def run_and_handle_errors(self): try: self.run() except CheckoutNeedsUpdate, e: log("Commit failed because the checkout is out of date. Please update and try again.") log("You can pass --no-build to skip building/testing after update if you believe the new commits did not affect the results.") WorkQueue.exit_after_handled_error(e) except ScriptError, e: # Mark the patch as commit-queue- and comment in the bug. self._tool.bugs.reject_patch_from_commit_queue(self._patch["id"], e.message_with_output()) WorkQueue.exit_after_handled_error(e) | 8d7ed037b5f22f994bf1dd483a68a42a888bd263 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9392/8d7ed037b5f22f994bf1dd483a68a42a888bd263/webkitlandingscripts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
464,
67,
4110,
67,
4324,
12,
2890,
4672,
775,
30,
365,
18,
2681,
1435,
1335,
29153,
26419,
1891,
16,
425,
30,
613,
2932,
5580,
2535,
2724,
326,
13926,
353,
596,
434,
1509,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
464,
67,
4110,
67,
4324,
12,
2890,
4672,
775,
30,
365,
18,
2681,
1435,
1335,
29153,
26419,
1891,
16,
425,
30,
613,
2932,
5580,
2535,
2724,
326,
13926,
353,
596,
434,
1509,
18... |
from sphinx.textwriter import TextWriter | from sphinx.writers.text import TextWriter | def issue_role(typ, rawtext, text, lineno, inliner, options={}, content=[]): issue = utils.unescape(text) text = 'issue ' + issue refnode = nodes.reference(text, text, refuri=ISSUE_URI % issue) return [refnode], [] | eac8c25bd44d651e4ff6fdd7697abc71647e14b4 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/eac8c25bd44d651e4ff6fdd7697abc71647e14b4/pyspecific.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5672,
67,
4615,
12,
12846,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
16,
702,
28793,
913,
33,
8526,
4672,
5672,
273,
2990,
18,
318,
6939,
12,
955,
13,
977,
273,
296,
1388... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5672,
67,
4615,
12,
12846,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
16,
702,
28793,
913,
33,
8526,
4672,
5672,
273,
2990,
18,
318,
6939,
12,
955,
13,
977,
273,
296,
1388... |
Return True if the quaternion algebra is a division algebra (i.e. a ring, not necessarily commutative, in which every nonzero element is invertible). So if this returns False, the quaternion algebra is isomorphic to the 2x2 matrix algebra. | Return True if the quaternion algebra is a division algebra (i.e. every nonzero element in self is invertible), and False if the quaternion algebra is isomorphic to the 2x2 matrix algebra. | def is_division_algebra(self): """ Return True if the quaternion algebra is a division algebra (i.e. a ring, not necessarily commutative, in which every nonzero element is invertible). So if this returns False, the quaternion algebra is isomorphic to the 2x2 matrix algebra. EXAMPLES:: sage: QuaternionAlgebra(QQ,-5,-2).is_division_algebra() True sage: QuaternionAlgebra(1).is_division_algebra() False """ return self.discriminant() != 1 | fe177d7e9e5b87a4c01b1082cf61c4d867951ed1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/fe177d7e9e5b87a4c01b1082cf61c4d867951ed1/quaternion_algebra.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
353,
67,
2892,
1951,
67,
287,
29087,
12,
2890,
4672,
3536,
2000,
1053,
309,
326,
26774,
524,
29087,
353,
279,
16536,
524,
29087,
261,
77,
18,
73,
18,
3614,
16966,
930,
316,
365,
353,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2892,
1951,
67,
287,
29087,
12,
2890,
4672,
3536,
2000,
1053,
309,
326,
26774,
524,
29087,
353,
279,
16536,
524,
29087,
261,
77,
18,
73,
18,
3614,
16966,
930,
316,
365,
353,
9... |
for skill, amounts in tot['Skills'].iteritems(): if self.capDistance: amount = amounts['BaseCap'] - amounts['TotalBonus'] else: amount = amounts['TotalBonus'] self.insertSkill(amount, skill, "Skill") for skill, amounts in tot['Focus'].iteritems(): if self.capDistance: amount = amounts['BaseCap'] - amounts['TotalBonus'] else: amount = amounts['TotalBonus'] self.insertSkill(amount, skill + " Focus", "Skill") for bonus, amounts in tot['OtherBonuses'].iteritems(): if self.capDistance: amount = amounts['BaseCap'] - amounts['TotalBonus'] else: amount = amounts['TotalBonus'] self.insertSkill(amount, bonus, "Bonus") for bonus, amounts in tot['PvEBonuses'].iteritems(): if self.capDistance: amount = amounts['BaseCap'] - amounts['TotalBonus'] else: amount = amounts['TotalBonus'] self.insertSkill(amount, bonus + " (PvE)", "Bonus") | for skillkey, suffix, lookup in ( ('Skills', '', 'Skill'), ('Focus', ' Focus', 'Focus'), ('OtherBonuses', '', 'Bonus'), ('PvEBonuses', ' (PvE)', 'Bonus')): skills = tot[skillkey].keys() skills.sort() for skill in skills: amounts = tot[skillkey][skill] if self.capDistance: amount = amounts['BaseCap'] - amounts['TotalBonus'] else: amount = amounts['TotalBonus'] self.insertSkill(amount, skill + suffix, lookup) | def calculate(self): if self.nocalc: return errorcount = 0 charleveltext = str(self.CharLevel.text()) if charleveltext == '': charlevel = 1 else: charlevel = max(min(50, int(charleveltext)), 1) self.CharLevel.setText(str(charlevel)) for key, item in self.itemattrlist.iteritems(): if item.ActiveState != 'player': continue gemeffects = [] for i in range(0, item.slotCount()): slot = item.slot(i) if slot.slotType() != 'player': continue gemtype = slot.type() if gemtype == 'Unused': continue effect = slot.effect() if [gemtype, effect] in gemeffects: error_act = QAction('Two of same type of gem on %s' \ % key, self) if item.Location in JewelTabList: row = 1 col = JewelTabList.index(item.Location) else: row = 0 col = PieceTabList.index(item.Location) error_act.setData(QVariant((row << 8) | col)) self.errorsmenu.addAction(error_act) errorcount = errorcount + 1 gemeffects.append([gemtype, effect]) item = self.itemattrlist[self.currentTabLabel] self.ItemUtility.setText('%3.1f' % item.utility()) if item.ActiveState == 'player': imbuevals = item.listGemImbue() imbuepts = sum(imbuevals) itemimbue = item.itemImbue() for i in range(0, item.slotCount()): slot = item.slot(i) if i < len(imbuevals): self.Cost[i].setText(SC.formatCost(slot.gemCost())) self.Points[i].setText('%3.1f' % imbuevals[i]) if i < len(self.Name): self.Name[i].setText(slot.gemName(self.realm)) self.ItemImbue.setText('%3.1f' % imbuepts) self.ItemImbueTotal.setText(' / ' + unicode(itemimbue)) self.ItemCost.setText(SC.formatCost(item.cost())) self.ItemPrice.setText(SC.formatCost(item.price(self.pricingInfo))) if imbuepts >= (itemimbue + 6.0): self.ItemOvercharge.setText('Impossible') elif imbuepts < (itemimbue + 1.0): self.ItemOvercharge.setText('None') else: success = item.overchargeSuccess(self.crafterSkill) if success < 0: self.ItemOvercharge.setText('BOOM! (%d%%)' % success) else: self.ItemOvercharge.setText('%d%%' % success) tot = self.summarize() self.SkillsList.model().removeRows(0,self.SkillsList.model().rowCount()) for key, amounts in tot['Resists'].iteritems(): val = amounts['TotalBonus'] if not self.capDistance: if self.includeRacials: if amounts.has_key('RacialBonus'): rr = amounts['RacialBonus'] val += rr self.StatValue[key].setText(unicode(val)) else: basecap = amounts['BaseCap'] self.StatValue[key].setText(unicode(basecap - val)) for (key, datum) in tot['Stats'].iteritems(): ### XXX fix it if key == "% Power Pool" or key == "AF" or key == "Acuity": continue val = datum['TotalBonus'] if not self.capDistance: if tot['Stats'][key]['TotalCapBonus'] > 0: self.StatCap[key].setText( \ '('+str(tot['Stats'][key]['TotalCapBonus'])+')') else: self.StatCap[key].setText('-') self.StatValue[key].setText(unicode(val)) else: basecap = tot['Stats'][key]['BaseCap'] if tot['Stats'][key]['TotalCapBonus'] > 0: addcap = tot['Stats'][key]['BaseCapToCapBonus'] capmod = tot['Stats'][key]['TotalCapBonus'] capcap = addcap - capmod if capmod > addcap: capmod = addcap self.StatCap[key].setText('('+unicode(int(capcap))+')') else: capmod = 0 self.StatValue[key].setText(unicode(int(basecap + capmod) -val)) for skill, amounts in tot['Skills'].iteritems(): if self.capDistance: amount = amounts['BaseCap'] - amounts['TotalBonus'] else: amount = amounts['TotalBonus'] self.insertSkill(amount, skill, "Skill") for skill, amounts in tot['Focus'].iteritems(): if self.capDistance: amount = amounts['BaseCap'] - amounts['TotalBonus'] else: amount = amounts['TotalBonus'] self.insertSkill(amount, skill + " Focus", "Skill") for bonus, amounts in tot['OtherBonuses'].iteritems(): if self.capDistance: amount = amounts['BaseCap'] - amounts['TotalBonus'] else: amount = amounts['TotalBonus'] self.insertSkill(amount, bonus, "Bonus") for bonus, amounts in tot['PvEBonuses'].iteritems(): if self.capDistance: amount = amounts['BaseCap'] - amounts['TotalBonus'] else: amount = amounts['TotalBonus'] self.insertSkill(amount, bonus + " (PvE)", "Bonus") self.TotalCost.setText(SC.formatCost(tot['Cost'])) self.TotalPrice.setText(SC.formatCost(tot['Price'])) self.TotalUtility.setText('%3.1f' % tot['Utility']) self.errorsmenuid.setEnabled(errorcount > 0) | ad3196c4498c1f0b7b9adbf3af79680fe38a609e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6671/ad3196c4498c1f0b7b9adbf3af79680fe38a609e/ScWindow.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
12,
2890,
4672,
309,
365,
18,
82,
23735,
71,
30,
327,
555,
1883,
273,
374,
1149,
2815,
955,
273,
609,
12,
2890,
18,
2156,
2355,
18,
955,
10756,
309,
1149,
2815,
955,
422,
875,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4604,
12,
2890,
4672,
309,
365,
18,
82,
23735,
71,
30,
327,
555,
1883,
273,
374,
1149,
2815,
955,
273,
609,
12,
2890,
18,
2156,
2355,
18,
955,
10756,
309,
1149,
2815,
955,
422,
875,
... |
if options.type == 'thumbnail': thumbnail(files_list) elif options.type == 'resize': resize(files_list) elif options.type == 'crop': crop(files_list) | try: getattr(Test, options.type)(files_list) except AttributeError: print "%s doesn\'t exist" % options.type | def roll(image, delta): "Roll an image sideways" xsize, ysize = image.size delta = delta % xsize if delta == 0: return image part1 = image.crop((0, 0, delta, ysize)) part2 = image.crop((delta, 0, xsize, ysize)) image.paste(part2, (0, 0, xsize-delta, ysize)) image.paste(part1, (xsize-delta, 0, xsize, ysize)) return image | d54f25435adbff08da206ffef8882757ca950b01 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4038/d54f25435adbff08da206ffef8882757ca950b01/tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5824,
12,
2730,
16,
3622,
4672,
315,
24194,
392,
1316,
4889,
3052,
6,
225,
619,
1467,
16,
677,
1467,
273,
1316,
18,
1467,
225,
3622,
273,
3622,
738,
619,
1467,
309,
3622,
422,
374,
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,
5824,
12,
2730,
16,
3622,
4672,
315,
24194,
392,
1316,
4889,
3052,
6,
225,
619,
1467,
16,
677,
1467,
273,
1316,
18,
1467,
225,
3622,
273,
3622,
738,
619,
1467,
309,
3622,
422,
374,
30,... |
self.row = asarray(ij[0], 'i') self.col = asarray(ij[1], 'i') | self.row = asarray(ij[0]) self.col = asarray(ij[1]) | def __init__(self, obj, ij, dims=None, nzmax=None, dtype=None): spmatrix.__init__(self) try: # Assume the first calling convention assert len(ij) == 2 if dims is None: M = int(amax(ij[0])) N = int(amax(ij[1])) self.shape = (M, N) else: # Use 2 steps to ensure dims has length 2. M, N = dims self.shape = (M, N) self.row = asarray(ij[0], 'i') self.col = asarray(ij[1], 'i') self.data = asarray(obj, dtype=dtype) self.dtypechar = self.data.dtypechar if nzmax is None: nzmax = len(self.data) self.nzmax = nzmax self._check() except Exception, e: raise e, "invalid input format" | 0b2d25691f3b5b478761024814ba8dc28534e0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12971/0b2d25691f3b5b478761024814ba8dc28534e0fb/sparse.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
1081,
16,
19313,
16,
9914,
33,
7036,
16,
15062,
1896,
33,
7036,
16,
3182,
33,
7036,
4672,
1694,
5667,
16186,
2738,
972,
12,
2890,
13,
775,
30,
468,
15983... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1081,
16,
19313,
16,
9914,
33,
7036,
16,
15062,
1896,
33,
7036,
16,
3182,
33,
7036,
4672,
1694,
5667,
16186,
2738,
972,
12,
2890,
13,
775,
30,
468,
15983... |
tags[self.tagnum]['genre'] = fileref.tag().genre | tags[self.tagnum]['genre'] = tag.genre | def tags_win_update(self, window, tags, entries, entries_names): self.updating_edit_entries = True # Populate tags(). Note that we only retrieve info from the # file if the info hasn't already been changed: fileref = tagpy.FileRef(tags[self.tagnum]['fullpath']) if not tags[self.tagnum]['title-changed']: tags[self.tagnum]['title'] = fileref.tag().title if not tags[self.tagnum]['artist-changed']: tags[self.tagnum]['artist'] = fileref.tag().artist if not tags[self.tagnum]['album-changed']: tags[self.tagnum]['album'] = fileref.tag().album if not tags[self.tagnum]['year-changed']: tags[self.tagnum]['year'] = fileref.tag().year if not tags[self.tagnum]['track-changed']: tags[self.tagnum]['track'] = fileref.tag().track if not tags[self.tagnum]['genre-changed']: tags[self.tagnum]['genre'] = fileref.tag().genre if not tags[self.tagnum]['comment-changed']: tags[self.tagnum]['comment'] = fileref.tag().comment # Update interface: entries[0].set_text(self.tags_get_tag(tags[self.tagnum], 'title')) entries[1].set_text(self.tags_get_tag(tags[self.tagnum], 'artist')) entries[2].set_text(self.tags_get_tag(tags[self.tagnum], 'album')) if self.tags_get_tag(tags[self.tagnum], 'year') != 0: entries[3].set_text(str(self.tags_get_tag(tags[self.tagnum], 'year'))) else: entries[3].set_text('') if self.tags_get_tag(tags[self.tagnum], 'track') != 0: entries[4].set_text(str(self.tags_get_tag(tags[self.tagnum], 'track'))) else: entries[4].set_text('') entries[5].set_text(self.tags_get_tag(tags[self.tagnum], 'genre')) entries[6].set_text(self.tags_get_tag(tags[self.tagnum], 'comment')) self.curr_mpdpath = gobject.filename_display_name(tags[self.tagnum]['mpdpath']) filename = self.curr_mpdpath if not self.use_mpdpaths: filename = os.path.basename(filename) entries[7].set_text(filename) entries[0].select_region(0, len(entries[0].get_text())) entries[0].grab_focus() window.set_title(_("Edit Tags") + " - " + str(self.tagnum+1) + " " + _("of") + " " + str(len(tags))) self.updating_edit_entries = False # Update text colors as appropriate: for i in range(len(entries)-1): if tags[self.tagnum][entries_names[i] + '-changed']: self.tags_win_entry_changed(entries[i]) else: self.tags_win_entry_revert_color(entries[i]) self.tags_win_set_sensitive(window.action_area) | f46c857512301d1836864c51b4a0d938e9c1cf02 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2312/f46c857512301d1836864c51b4a0d938e9c1cf02/tagedit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2342,
67,
8082,
67,
2725,
12,
2890,
16,
2742,
16,
2342,
16,
3222,
16,
3222,
67,
1973,
4672,
365,
18,
5533,
1776,
67,
4619,
67,
8219,
273,
1053,
468,
22254,
2342,
7675,
3609,
716,
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,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2342,
67,
8082,
67,
2725,
12,
2890,
16,
2742,
16,
2342,
16,
3222,
16,
3222,
67,
1973,
4672,
365,
18,
5533,
1776,
67,
4619,
67,
8219,
273,
1053,
468,
22254,
2342,
7675,
3609,
716,
732,
... |
oscmd(PREFIX + "/built/bin/egg2bam" + dotexe + " " + egg + " " + bam) | oscmd(PREFIX + "/built/bin/egg2bam" + dotexe + " -pr " + preconv + " -o " + bam + " " + egg) | def CompileBAM(bam, egg): dotexe = ".exe" if (sys.platform != "win32"): dotexe = "" if (egg[-4:]==".flt"): oscmd(PREFIX + "/built/bin/flt2egg" + dotexe + " " + egg + " " + PREFIX + "/tmp/tmp.egg") oscmd(PREFIX + "/built/bin/egg2bam" + dotexe + " " + PREFIX + "/tmp/tmp.egg" + " " + bam) else: oscmd(PREFIX + "/built/bin/egg2bam" + dotexe + " " + egg + " " + bam) | 37dba03aa7789ae67e14f92b91ba92b911952d35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7242/37dba03aa7789ae67e14f92b91ba92b911952d35/makepanda.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
38,
2192,
12,
11477,
16,
25144,
4672,
3928,
14880,
273,
3552,
14880,
6,
309,
261,
9499,
18,
9898,
480,
315,
8082,
1578,
6,
4672,
3928,
14880,
273,
1408,
309,
261,
23171,
18919,
24... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16143,
38,
2192,
12,
11477,
16,
25144,
4672,
3928,
14880,
273,
3552,
14880,
6,
309,
261,
9499,
18,
9898,
480,
315,
8082,
1578,
6,
4672,
3928,
14880,
273,
1408,
309,
261,
23171,
18919,
24... |
args.append(pyexec) | args.append('"%s"' % pyexec) | def create_shortcut(ws, dp_folder, ver_name, pyexec): """ Create a shortcut. ws should be a Shell COM object. dp_folder should be the folder where the shortcuts are created. If ver_name is None, the shortcut will be "DreamPie" instead of "DreamPie ({ver_name})". If pyexec is None, will start dreampie.exe with no arguments. """ if ver_name: shortcut_name = "DreamPie (Python %s).lnk" % ver_name else: shortcut_name = "DreamPie.lnk" shortcut_fn = join(dp_folder, shortcut_name) shortcut = ws.CreateShortcut(shortcut_fn).QueryInterface(IWshRuntimeLibrary.IWshShortcut) shortcut.TargetPath = abspath(join(dirname(sys.executable), "dreampie.exe")) args = ['--hide-console-window'] if pyexec: args.append(pyexec) shortcut.WorkingDirectory = dirname(pyexec) shortcut.Arguments = ' '.join(args) shortcut.Save() | edcfc7898b52be0dd7a9c0d19ddd58b5769b7a99 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10932/edcfc7898b52be0dd7a9c0d19ddd58b5769b7a99/create-shortcuts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
67,
24744,
12,
4749,
16,
9986,
67,
5609,
16,
1924,
67,
529,
16,
2395,
4177,
4672,
3536,
1788,
279,
10995,
18,
4945,
1410,
506,
279,
19433,
5423,
733,
18,
9986,
67,
5609,
1410,
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,
24744,
12,
4749,
16,
9986,
67,
5609,
16,
1924,
67,
529,
16,
2395,
4177,
4672,
3536,
1788,
279,
10995,
18,
4945,
1410,
506,
279,
19433,
5423,
733,
18,
9986,
67,
5609,
1410,
506... |
env.AppendUnique( LIBPATH= [ env['flex_lib'] ] ) | env.AppendUnique( LIBPATH= [ env['flex_lib'] ] ) env.AppendUnique( CPPPATH= [ env['flex_include'] ] ) | def update( self, env ): """ Update the environment with specific flags """ | 7b5431d7dbfd7f358c047c82cd325608e3bbd337 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6794/7b5431d7dbfd7f358c047c82cd325608e3bbd337/flex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
365,
16,
1550,
262,
30,
3536,
2315,
326,
3330,
598,
2923,
2943,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1089,
12,
365,
16,
1550,
262,
30,
3536,
2315,
326,
3330,
598,
2923,
2943,
3536,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if help is not None and '?' not in allowed: allowed += help_keys | def ask_question(self, question, allowed, help=None, help_keys='hH?'): with self.channel.locked_output(): with self.new_prompt(question): while True: if help is not None and '?' not in allowed: allowed += help_keys try: type, value = self.recv_char(allowed) if type=='key': value = value[0] if help is not None and value in help_keys: self.write(help) else: return value else: break except ConnectionDone: raise GreenletExit | 32f99f17d3587fa8a4e67809ffcdec15afff473f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3449/32f99f17d3587fa8a4e67809ffcdec15afff473f/consolebuffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6827,
67,
4173,
12,
2890,
16,
5073,
16,
2935,
16,
2809,
33,
7036,
16,
2809,
67,
2452,
2218,
76,
44,
4899,
4672,
598,
365,
18,
4327,
18,
15091,
67,
2844,
13332,
598,
365,
18,
2704,
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,
6827,
67,
4173,
12,
2890,
16,
5073,
16,
2935,
16,
2809,
33,
7036,
16,
2809,
67,
2452,
2218,
76,
44,
4899,
4672,
598,
365,
18,
4327,
18,
15091,
67,
2844,
13332,
598,
365,
18,
2704,
67... | |
_introspecting[oid] = prop_doc | def introspect_property(prop): """Add API documentation information about the property C{prop} to C{prop_doc} (specializing it to C{PropertyDoc}).""" # Create the PropertyDoc oid = id(prop) if oid in _introspecting: return _introspecting[oid] prop_doc = PropertyDoc(pyval=prop, repr=value_repr(prop), canonical_name = get_canonical_name(prop)) _introspecting[oid] = prop_doc # Record the property's docstring. prop_doc.docstring = get_docstring(prop) # Record the property's access functions. prop_doc.fget = introspect_docs(prop.fget) prop_doc.fset = introspect_docs(prop.fset) prop_doc.fdel = introspect_docs(prop.fdel) return prop_doc | 8306498614e7db9ddd2c5e78aa700eded3f33a2e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/8306498614e7db9ddd2c5e78aa700eded3f33a2e/docintrospecter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30165,
67,
4468,
12,
5986,
4672,
3536,
986,
1491,
7323,
1779,
2973,
326,
1272,
385,
95,
5986,
97,
358,
385,
95,
5986,
67,
2434,
97,
261,
9371,
6894,
518,
358,
385,
95,
1396,
1759,
6792... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30165,
67,
4468,
12,
5986,
4672,
3536,
986,
1491,
7323,
1779,
2973,
326,
1272,
385,
95,
5986,
97,
358,
385,
95,
5986,
67,
2434,
97,
261,
9371,
6894,
518,
358,
385,
95,
1396,
1759,
6792... | |
assert(self.date is not None, "Must set date to use IMAPMessage instance.") | assert self.date is not None, \ "Must set date to use IMAPMessage instance." | def getInternalDate(self): """Retrieve the date internally associated with this message.""" assert(self.date is not None, "Must set date to use IMAPMessage instance.") return self.date | 015f3d563a5a237bd8c4901c7368d0ee044ad991 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/015f3d563a5a237bd8c4901c7368d0ee044ad991/sb_pop3dnd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
16918,
1626,
12,
2890,
4672,
3536,
5767,
326,
1509,
12963,
3627,
598,
333,
883,
12123,
1815,
365,
18,
712,
353,
486,
599,
16,
521,
315,
10136,
444,
1509,
358,
999,
6246,
2203,
1079,
791,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
16918,
1626,
12,
2890,
4672,
3536,
5767,
326,
1509,
12963,
3627,
598,
333,
883,
12123,
1815,
365,
18,
712,
353,
486,
599,
16,
521,
315,
10136,
444,
1509,
358,
999,
6246,
2203,
1079,
791,... |
elif line == '': | elif not line: | def _generate_toc(self): """Generate key-to-(start, stop) table of contents.""" starts, stops = [], [] self._file.seek(0) next_pos = 0 while True: line_pos = next_pos line = self._file.readline() next_pos = self._file.tell() if line.startswith('\001\001\001\001' + os.linesep): starts.append(next_pos) while True: line_pos = next_pos line = self._file.readline() next_pos = self._file.tell() if line == '\001\001\001\001' + os.linesep: stops.append(line_pos - len(os.linesep)) break elif line == '': stops.append(line_pos) break elif line == '': break self._toc = dict(enumerate(zip(starts, stops))) self._next_key = len(self._toc) self._file.seek(0, 2) self._file_length = self._file.tell() | 3ae5cf1ce9baf6330ccf73291ebfeaee2c111013 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/3ae5cf1ce9baf6330ccf73291ebfeaee2c111013/mailbox.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7163,
67,
1391,
12,
2890,
4672,
3536,
4625,
498,
17,
869,
17,
12,
1937,
16,
2132,
13,
1014,
434,
2939,
12123,
2542,
16,
12349,
273,
5378,
16,
5378,
365,
6315,
768,
18,
16508,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
7163,
67,
1391,
12,
2890,
4672,
3536,
4625,
498,
17,
869,
17,
12,
1937,
16,
2132,
13,
1014,
434,
2939,
12123,
2542,
16,
12349,
273,
5378,
16,
5378,
365,
6315,
768,
18,
16508,
12,
... |
def get_valueOf_(self): return self.valueOf_ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_ | def get_valueOf_(self): return self.valueOf_ | 9c12e50d449fa27d6f8f3415ece228ae97bb0266 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14016/9c12e50d449fa27d6f8f3415ece228ae97bb0266/_nexml.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1132,
951,
67,
12,
2890,
4672,
327,
365,
18,
1132,
951,
67,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1132,
951,
67,
12,
2890,
4672,
327,
365,
18,
1132,
951,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
raise CompressionError, "unsupported compression method" | raise CompressionError("unsupported compression method") | def _init_read_gz(self): """Initialize for reading a gzip compressed fileobj. """ self.cmp = self.zlib.decompressobj(-self.zlib.MAX_WBITS) self.dbuf = "" | e4751e3cdc8c271f24e46a6155f255b6e33da158 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/e4751e3cdc8c271f24e46a6155f255b6e33da158/tarfile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
896,
67,
9764,
12,
2890,
4672,
3536,
7520,
364,
6453,
279,
10331,
8968,
17041,
18,
3536,
365,
18,
9625,
273,
365,
18,
94,
2941,
18,
323,
14706,
2603,
19236,
2890,
18,
94... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2738,
67,
896,
67,
9764,
12,
2890,
4672,
3536,
7520,
364,
6453,
279,
10331,
8968,
17041,
18,
3536,
365,
18,
9625,
273,
365,
18,
94,
2941,
18,
323,
14706,
2603,
19236,
2890,
18,
94... |
r""" Permanent of (0,1)-matrix of size $n \times (n+d)$ with $d=5$ and $n-1$ zeros not on a line. $a(n) = (n+1)*a(n-1) + (n-2)*a(n-2) [a(1)=6, a(2)=36]$ This is a special case of Theorem 2.3 of Seok-Zun Song et al. Extremes of permanents of (0,1)-matrices, p. 201-202. REFERENCES: Seok-Zun Song et al., Extremes of permanents of (0,1)-matrices, Lin. Algebra and its Applic. 373 (2003), p. 197-210. INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A090015;a Permanent of (0,1)-matrix of size n X (n+d) with d=3 and n-1 zeros not on a line. sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(1) 6 sage: a(2) 36 sage: a.offset 1 sage: a(8) 29976192 sage: a(22) 41552258517692116794936876 sage: a.list(9) [6, 36, 258, 2136, 19998, 208524, 2393754, 29976192, 406446774] AUTHOR: -- Jaap Spies (2007-01-23) """ def __init__(self): | def __init__(self): r""" Permanent of (0,1)-matrix of size $n \times (n+d)$ with $d=5$ and $n-1$ zeros not on a line. $a(n) = (n+1)*a(n-1) + (n-2)*a(n-2) [a(1)=6, a(2)=36]$ This is a special case of Theorem 2.3 of Seok-Zun Song et al. Extremes of permanents of (0,1)-matrices, p. 201-202. REFERENCES: Seok-Zun Song et al., Extremes of permanents of (0,1)-matrices, Lin. Algebra and its Applic. 373 (2003), p. 197-210. INPUT: n -- positive integer OUTPUT: integer -- function value EXAMPLES: sage: a = sloane.A090015;a Permanent of (0,1)-matrix of size n X (n+d) with d=3 and n-1 zeros not on a line. sage: a(0) Traceback (most recent call last): ... ValueError: input n (=0) must be a positive integer sage: a(1) 6 sage: a(2) 36 sage: a.offset 1 sage: a(8) 29976192 sage: a(22) 41552258517692116794936876 sage: a.list(9) [6, 36, 258, 2136, 19998, 208524, 2393754, 29976192, 406446774] AUTHOR: -- Jaap Spies (2007-01-23) """ | def _eval(self, n): if n == 1: return ZZ(5) else: return sloane.A001909(n+3) + sloane.A001909(n+2) | 7b02e5455d5d52d6dcc7f2314cdd56803031a1c6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/7b02e5455d5d52d6dcc7f2314cdd56803031a1c6/sloane_functions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
309,
290,
422,
404,
30,
327,
2285,
62,
12,
25,
13,
469,
30,
327,
225,
272,
383,
8806,
18,
37,
713,
3657,
5908,
12,
82,
15,
23,
13,
397,
272,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
8622,
12,
2890,
16,
290,
4672,
309,
290,
422,
404,
30,
327,
2285,
62,
12,
25,
13,
469,
30,
327,
225,
272,
383,
8806,
18,
37,
713,
3657,
5908,
12,
82,
15,
23,
13,
397,
272,
3... |
' WHERE name in (%s)' % (','.join(['%s'] * len(self))), additional_data.keys() | ' WHERE name in %s',(tuple(additional_data),) | def update_from_db(self, cr): # update the graph with values from the database (if exist) ## First, we set the default values for each package in graph additional_data = dict.fromkeys(self.keys(), {'id': 0, 'state': 'uninstalled', 'dbdemo': False, 'installed_version': None}) ## Then we get the values from the database cr.execute('SELECT name, id, state, demo AS dbdemo, latest_version AS installed_version' ' FROM ir_module_module' ' WHERE name in (%s)' % (','.join(['%s'] * len(self))), additional_data.keys() ) | f33171198680a04a1dc6a2802531abf41f054884 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/f33171198680a04a1dc6a2802531abf41f054884/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
2080,
67,
1966,
12,
2890,
16,
4422,
4672,
468,
1089,
326,
2667,
598,
924,
628,
326,
2063,
261,
430,
1005,
13,
7541,
5783,
16,
732,
444,
326,
805,
924,
364,
1517,
2181,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2080,
67,
1966,
12,
2890,
16,
4422,
4672,
468,
1089,
326,
2667,
598,
924,
628,
326,
2063,
261,
430,
1005,
13,
7541,
5783,
16,
732,
444,
326,
805,
924,
364,
1517,
2181,
316,
... |
""" fl_addto_form(form) -> form ref. | """ fl_addto_form(form) -> form | def fl_addto_form(form): """ fl_addto_form(form) -> form ref. """ retval = _fl_addto_form(form) return retval | 8765c710f695de392f6fc7c664c746ec98668b1d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/8765c710f695de392f6fc7c664c746ec98668b1d/xformslib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1183,
67,
1289,
869,
67,
687,
12,
687,
4672,
3536,
1183,
67,
1289,
869,
67,
687,
12,
687,
13,
317,
646,
3536,
225,
5221,
273,
389,
2242,
67,
1289,
869,
67,
687,
12,
687,
13,
327,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1183,
67,
1289,
869,
67,
687,
12,
687,
4672,
3536,
1183,
67,
1289,
869,
67,
687,
12,
687,
13,
317,
646,
3536,
225,
5221,
273,
389,
2242,
67,
1289,
869,
67,
687,
12,
687,
13,
327,
5... |
""" create a member area | """ Create a member area for 'member_id'. | def createMemberarea(self, member_id): """ create a member area """ parent = self.aq_inner.aq_parent members = getattr(parent, 'Members', None) | 8232ef475ca9d52eac5bad772f694aadfeefca9f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1843/8232ef475ca9d52eac5bad772f694aadfeefca9f/MembershipTool.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
4419,
5036,
12,
2890,
16,
3140,
67,
350,
4672,
225,
3536,
1788,
279,
3140,
5091,
364,
296,
5990,
67,
350,
10332,
3536,
982,
273,
365,
18,
69,
85,
67,
7872,
18,
69,
85,
67,
2938,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
752,
4419,
5036,
12,
2890,
16,
3140,
67,
350,
4672,
225,
3536,
1788,
279,
3140,
5091,
364,
296,
5990,
67,
350,
10332,
3536,
982,
273,
365,
18,
69,
85,
67,
7872,
18,
69,
85,
67,
2938,... |
numMasters, = unpack('B',1) | numMasters,delim = unpack('Bc',2) | def pack(format,*args): out.write(struct.pack(format,*args)) | 6a02625d5f2d736dbd19ab9b5f1a55b0691055f7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6682/6a02625d5f2d736dbd19ab9b5f1a55b0691055f7/bosh.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2298,
12,
2139,
16,
14,
1968,
4672,
596,
18,
2626,
12,
1697,
18,
2920,
12,
2139,
16,
14,
1968,
3719,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2298,
12,
2139,
16,
14,
1968,
4672,
596,
18,
2626,
12,
1697,
18,
2920,
12,
2139,
16,
14,
1968,
3719,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
try: base64.decodestring("") except binascii_error: pass else: self.fail("expected a binascii.Error on null decode request") | test_support.verify(base64.decodestring('') == '') | def test_decode_string(self): """Testing decode string""" test_support.verify(base64.decodestring("d3d3LnB5dGhvbi5vcmc=\n") == "www.python.org", reason="www.python.org decodestring failed") test_support.verify(base64.decodestring("YQ==\n") == "a", reason="a decodestring failed") test_support.verify(base64.decodestring("YWI=\n") == "ab", reason="ab decodestring failed") test_support.verify(base64.decodestring("YWJj\n") == "abc", reason="abc decodestring failed") test_support.verify(base64.decodestring( "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXpBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWjAxMjM0\nNTY3ODkhQCMwXiYqKCk7Ojw+LC4gW117fQ==\n") == "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#0^&*();:<>,. []{}", reason = "long decodestring failed") try: base64.decodestring("") except binascii_error: pass else: self.fail("expected a binascii.Error on null decode request") | 2d30bafb924fb4343d42307f2023c8ca76845064 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/2d30bafb924fb4343d42307f2023c8ca76845064/test_base64.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3922,
67,
1080,
12,
2890,
4672,
3536,
22218,
2495,
533,
8395,
1842,
67,
13261,
18,
8705,
12,
1969,
1105,
18,
4924,
1145,
371,
2932,
72,
23,
72,
23,
13780,
38,
25,
72,
43,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
3922,
67,
1080,
12,
2890,
4672,
3536,
22218,
2495,
533,
8395,
1842,
67,
13261,
18,
8705,
12,
1969,
1105,
18,
4924,
1145,
371,
2932,
72,
23,
72,
23,
13780,
38,
25,
72,
43,
7... |
payload_completed_count = 0 | old_payload_completed_count = 0 | def runAdobeInstallTool(cmd, number_of_payloads=0, killAdobeAIR=False): '''An abstraction of the tasks for running Adobe Setup, AdobeUberInstaller, AdobeUberUninstaller, AdobeDeploymentManager, etc''' if munkicommon.munkistatusoutput and not number_of_payloads: # indeterminate progress bar munkistatus.percent(-1) proc = subprocess.Popen(cmd, shell=False, bufsize=1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) payload_completed_count = 0 payloadname = "" while (proc.poll() == None): time.sleep(1) (payload_completed_count, payloadname) = \ getAdobeInstallProgressInfo(payload_completed_count, payloadname) if payload_completed_count > 0: if payloadname: payloadinfo = " - " + payloadname else: payloadinfo = "" if number_of_payloads: munkicommon.display_status("Completed payload %s of %s%s" % (payload_completed_count, number_of_payloads, payloadinfo)) else: munkicommon.display_status("Completed payload %s%s" % (payload_completed_count, payloadinfo)) if munkicommon.munkistatusoutput: munkistatus.percent(getPercent(payload_completed_count, number_of_payloads)) # Adobe AIR Installer workaround/hack # CSx installs at the loginwindow hang when Adobe AIR is installed. # So we check for this and kill the process. Ugly. # Hopefully we can disable this in the future. if killAdobeAIR: if (not munkicommon.getconsoleuser() or munkicommon.getconsoleuser() == u"loginwindow"): # we're at the loginwindow. if processRunning("Adobe AIR Installer"): # Adobe AIR Installer is running, we should kill it munkicommon.log("Killing Adobe AIR Installer") retcode = subprocess.call( ["/usr/bin/killall", "-KILL", "Adobe AIR Installer"]) # run of tool completed retcode = proc.poll() #check output for errors output = proc.stdout.readlines() for line in output: line = line.rstrip("\n") if line.startswith("Error"): munkicommon.display_error(line) if line.startswith("Exit Code:"): if retcode == 0: try: retcode = int(line[11:]) except (ValueError, TypeError): retcode = -1 if retcode != 0 and retcode != 8: munkicommon.display_error("Adobe Setup error: %s: %s" % (retcode, adobeSetupError(retcode))) else: if munkicommon.munkistatusoutput: munkistatus.percent(100) munkicommon.display_status("Done.") return retcode | e5c160b86f6f8c0c48e4a280254434ac50dfbb11 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6241/e5c160b86f6f8c0c48e4a280254434ac50dfbb11/adobeutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
1871,
947,
73,
6410,
6364,
12,
4172,
16,
1300,
67,
792,
67,
7648,
87,
33,
20,
16,
8673,
1871,
947,
73,
37,
7937,
33,
8381,
4672,
9163,
979,
1223,
701,
1128,
434,
326,
4592,
364... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1871,
947,
73,
6410,
6364,
12,
4172,
16,
1300,
67,
792,
67,
7648,
87,
33,
20,
16,
8673,
1871,
947,
73,
37,
7937,
33,
8381,
4672,
9163,
979,
1223,
701,
1128,
434,
326,
4592,
364... |
@cmdln.option('-r', '--region', metavar='XY', | @cmdln.option('-r', metavar='XY', | def do_new(self, subcmd, opts, identifier): """${cmd_name}: insert a new mirror into the database | e1ef967e0444eaa3c215d0c3d8ce15bd50cc9098 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10990/e1ef967e0444eaa3c215d0c3d8ce15bd50cc9098/mirrordoctor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
2704,
12,
2890,
16,
720,
4172,
16,
1500,
16,
2756,
4672,
3536,
18498,
4172,
67,
529,
6713,
2243,
279,
394,
15593,
1368,
326,
2063,
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,
0,
0,
0,
0,
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,
67,
2704,
12,
2890,
16,
720,
4172,
16,
1500,
16,
2756,
4672,
3536,
18498,
4172,
67,
529,
6713,
2243,
279,
394,
15593,
1368,
326,
2063,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
else | else: | def __init__(data = None) if data == None: quickfix.IntField.__init__(self, 290) else quickfix.IntField.__init__(self, 290, data) | 484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
576,
9349,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
13,
309,
501,
422,
599,
30,
9549,
904,
18,
1702,
974,
16186,
2738,
972,
12,
2890,
16,
576,
9349,
13,
469,
30,
9549,
904,
18,
1702,
974,
16186,
273... |
vprint("selected imap folder %s" % imap_folder) | def _archive_imap(mailbox_name, final_archive_name): """Archive an imap mailbox - used by archive_mailbox()""" assert(mailbox_name) assert(final_archive_name) import imaplib import cStringIO import getpass archive = None stats = Stats(mailbox_name, final_archive_name) cache = IdentityCache(mailbox_name) imap_str = mailbox_name[mailbox_name.find('://') + 3:] imap_filter = build_imap_filter() vprint("imap filter: '%s'" % imap_filter) imap_username, imap_password, imap_server, imap_folder = \ parse_imap_url(imap_str) if not imap_password: if options.pwfile: imap_password = open(options.pwfile).read().rstrip() else: if (not os.isatty(sys.stdin.fileno())) or options.quiet: unexpected_error("No imap password specified") imap_password = getpass.getpass('IMAP password: ') if mailbox_name[:5] == 'imaps': imap_srv = imaplib.IMAP4_SSL(imap_server) vprint("established secure connection to server %s" % imap_server) else: imap_srv = imaplib.IMAP4(imap_server) vprint("established connection to server %s" % imap_server) try: result, response = imap_srv.login_cram_md5(imap_username, imap_password) except imaplib.IMAP4.error: result, response = imap_srv.login(imap_username, imap_password) vprint("logged in to server as %s" % imap_username) if options.dry_run or options.copy_old_mail: result, response = imap_srv.select(imap_folder, readonly=True) else: result, response = imap_srv.select(imap_folder) if result != 'OK': unexpected_error("cannot select imap folder; " "server says '%s'" % response[0]) vprint("selected imap folder %s" % imap_folder) # response is e.g. ['1016'] for 1016 messages in folder total_msg_count = int(response[0]) vprint("folder has %d message(s)" % total_msg_count) # IIUIC the message sequence numbers are stable for the whole session, since # we just send SEARCH, FETCH and STORE commands, which should prevent the # server from sending untagged EXPUNGE responses -- see RFC 3501 (IMAP4rev1) # 7.4.1 and RFC 2180 (Multi-Accessed Mailbox Practice). # Worst thing should be that we bail out FETCHing a message that has been # deleted. result, response = imap_srv.search(None, imap_filter) if result != 'OK': unexpected_error("imap search failed; server says '%s'" % response[0]) # response is a list with a single item, listing message sequence numbers # like ['1 2 3 1016'] message_list = response[0].split() vprint("%d messages are matching filter" % len(message_list)) # First, gather data for the statistics. if total_msg_count > 0: result, response = imap_srv.fetch('1:*', '(RFC822.SIZE)') if result != 'OK': unexpected_error("Failed to fetch message sizes; " "server says '%s'" % response[0]) # response is a list with entries like '1016 (RFC822.SIZE 3118)', # where the first number is the message sequence number, the second is # the size. for x in response: msn, blurb, msg_size = x.split() msg_size = int(msg_size.rstrip(')')) stats.another_message(msg_size) if msn in message_list: stats.another_archived(msg_size) if not options.dry_run: if not options.delete_old_mail: for msn in message_list: # Fetching message flags and body together always finds \Seen # set. To check \Seen, we must fetch the flags first. result, response = imap_srv.fetch(msn, '(FLAGS)') if result != 'OK': unexpected_error("Failed to fetch message " "flags; server says '%s'" % response[0]) msg_flags = imaplib.ParseFlags(response[0]) result, response = imap_srv.fetch(msn, '(RFC822)') if result != 'OK': unexpected_error("Failed to fetch message; " "server says '%s'" % response[0]) if "\r\n" == os.linesep: msg_str = response[0][1] else: msg_str = response[0][1].replace("\r\n", os.linesep) msg = rfc822.Message(cStringIO.StringIO(msg_str)) add_status_headers_imap(msg, msg_flags) vprint("processing message '%s'" % msg.get('Message-ID')) if options.warn_duplicates: cache.warn_if_dupe(msg) if not archive: archive = ArchiveMbox(final_archive_name) archive.write(msg) if archive: archive.close() archive.finalise() if not options.copy_old_mail: vprint("Deleting %s messages" % len(message_list)) # do not delete more than a certain number of messages at a time, # because the command length is limited. This avoids that servers # terminate the connection with EOF or TCP RST. max_delete = 100 for i in range(0, len(message_list), max_delete): result, response = imap_srv.store( \ string.join(message_list[i:i+max_delete], ','), '+FLAGS.SILENT', '\\Deleted') if result != 'OK': unexpected_error("Error while deleting " "messages; server says '%s'" % response[0]) imap_srv.close() imap_srv.logout() if not options.quiet: stats.display() | 1e5cb090e73ccf5e336f6a1eec0e854efa7396fd /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1746/1e5cb090e73ccf5e336f6a1eec0e854efa7396fd/archivemail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
10686,
67,
12161,
12,
4408,
2147,
67,
529,
16,
727,
67,
10686,
67,
529,
4672,
3536,
7465,
392,
20226,
14187,
300,
1399,
635,
5052,
67,
4408,
2147,
1435,
8395,
1815,
12,
4408,
2147,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
10686,
67,
12161,
12,
4408,
2147,
67,
529,
16,
727,
67,
10686,
67,
529,
4672,
3536,
7465,
392,
20226,
14187,
300,
1399,
635,
5052,
67,
4408,
2147,
1435,
8395,
1815,
12,
4408,
2147,
... | |
self.content_length = int( self.extract_header('Content-Length', 0)) self.data = self.data[newline+2:] | self.data = self.data[newline+1:] | def append(self, new_data): self.data += new_data while not self.headers_complete: newline = self.data.find('\n') if newline < 0: break # no complete line found line = self.data[:newline] if len(line) and line[-1] == '\r': line = line[:-1] if len(line): self.headers.append(line) else: self.headers_complete = True self.content_length = int( self.extract_header('Content-Length', 0)) self.data = self.data[newline+2:] if self.headers_complete: if len(self.data) >= self.content_length: self.complete = True self.extract_host() if len(self.data) > self.content_length: rest = self.data[self.content_length:] self.data = self.data[:self.content_length] while len(rest) and rest[0] in '\r\n': rest = rest[1:] return rest return '' | 7e0cf3dd4f4532da6b66e15206b18b95c2822de6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/3111/7e0cf3dd4f4532da6b66e15206b18b95c2822de6/throxy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
12,
2890,
16,
394,
67,
892,
4672,
365,
18,
892,
1011,
394,
67,
892,
1323,
486,
365,
18,
2485,
67,
6226,
30,
9472,
273,
365,
18,
892,
18,
4720,
2668,
64,
82,
6134,
309,
9472,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
714,
12,
2890,
16,
394,
67,
892,
4672,
365,
18,
892,
1011,
394,
67,
892,
1323,
486,
365,
18,
2485,
67,
6226,
30,
9472,
273,
365,
18,
892,
18,
4720,
2668,
64,
82,
6134,
309,
9472,
4... |
if getattr(model, '_already_run_alter_schema_trick', False): return | def _alter_sqlite_table(self, table_name, field_renames={}): """ Not supported under SQLite. """ model_name = table_name.replace('_', '.', 1) model = self.current_orm[model_name] if getattr(model, '_already_run_alter_schema_trick', False): return temp_name = table_name + "_temporary_for_schema_change" self.rename_table(table_name, temp_name) fields = [(fld.name, fld) for fld in model._meta.fields] self.create_table(table_name, fields) columns = [fld.column for name, fld in fields] self.copy_data(temp_name, table_name, columns, field_renames) self.delete_table(temp_name, cascade=False) model._already_run_alter_schema_trick = True | 9ac2fbab57c1645782a26d67b4a29cf5e9a9f5b7 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/13142/9ac2fbab57c1645782a26d67b4a29cf5e9a9f5b7/sqlite3.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
22628,
67,
19460,
67,
2121,
12,
2890,
16,
1014,
67,
529,
16,
652,
67,
1187,
753,
12938,
4672,
3536,
2288,
3260,
3613,
16192,
18,
3536,
938,
67,
529,
273,
1014,
67,
529,
18,
2079,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
22628,
67,
19460,
67,
2121,
12,
2890,
16,
1014,
67,
529,
16,
652,
67,
1187,
753,
12938,
4672,
3536,
2288,
3260,
3613,
16192,
18,
3536,
938,
67,
529,
273,
1014,
67,
529,
18,
2079,
... | |
field.context_validate(value) | fields.context_validate(value) | def check_context(self, cursor, user, ids): "Check context" for action in self.browse(cursor, user, ids): if action.context: try: value = safe_eval(action.context, CONTEXT) except: return False if isinstance(value, PYSON): if not value.types() == set([dict]): return False elif not isinstance(value, dict): return False else: try: field.context_validate(value) except: return False return True | 0128c0634ec99895d5441b2ea39a0cdbff1371f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9266/0128c0634ec99895d5441b2ea39a0cdbff1371f1/action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
2472,
12,
2890,
16,
3347,
16,
729,
16,
3258,
4672,
315,
1564,
819,
6,
364,
1301,
316,
365,
18,
25731,
12,
9216,
16,
729,
16,
3258,
4672,
309,
1301,
18,
2472,
30,
775,
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,
866,
67,
2472,
12,
2890,
16,
3347,
16,
729,
16,
3258,
4672,
315,
1564,
819,
6,
364,
1301,
316,
365,
18,
25731,
12,
9216,
16,
729,
16,
3258,
4672,
309,
1301,
18,
2472,
30,
775,
30,
... |
max_min = self.min_max() if max_min: return max_min[1] | min_max = self.min_max if min_max: return min_max[1] else: return None | def max( self ): max_min = self.min_max() if max_min: return max_min[1] | 4747773736163ba0f09ddc3c8e0103ae38f565ea /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10268/4747773736163ba0f09ddc3c8e0103ae38f565ea/ecl_kw.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
12,
365,
262,
30,
943,
67,
1154,
273,
365,
18,
1154,
67,
1896,
1435,
309,
943,
67,
1154,
30,
327,
943,
67,
1154,
63,
21,
65,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
943,
12,
365,
262,
30,
943,
67,
1154,
273,
365,
18,
1154,
67,
1896,
1435,
309,
943,
67,
1154,
30,
327,
943,
67,
1154,
63,
21,
65,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
cmdclass = { 'install' : openerp_server_install, 'build' : openerp_server_build }, | cmdclass = { 'install' : openerp_server_install, }, | def run(self): # create startup script start_script = "#!/bin/sh\ncd %s\nexec %s ./openerp-server.py $@\n" % (opj(self.install_libbase, "openerp-server"), sys.executable) # write script f = open('openerp-server', 'w') f.write(start_script) f.close() | a819a33163133576b9febc66524581b0b8a67977 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12853/a819a33163133576b9febc66524581b0b8a67977/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
468,
752,
11850,
2728,
787,
67,
4263,
273,
6619,
5,
19,
4757,
19,
674,
64,
82,
4315,
738,
87,
64,
82,
4177,
738,
87,
263,
19,
25098,
84,
17,
3567,
18,
2074,
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,
4672,
468,
752,
11850,
2728,
787,
67,
4263,
273,
6619,
5,
19,
4757,
19,
674,
64,
82,
4315,
738,
87,
64,
82,
4177,
738,
87,
263,
19,
25098,
84,
17,
3567,
18,
2074,
2... |
self.__utf_exp = re.compile(r"\\u(-?\d{3,6}) {0,1}") | self.__utf_exp = re.compile(r"\\u(-?\d{3,6}) ?") self.__bin_exp = re.compile(r"(?:\\bin(-?\d{0,10})[\n ]+)[01\n]+") self.__utf_ud = re.compile(r"\\{[\n ]?\\upr[\n ]?(?:\\{.*?\\})[\n ]?" + \ r"\\{[\n ]?\\*[\n ]?\\ud[\n ]?(\\{.*?\\})[\n ]?\\}[\n ]?\\}") self.__splitexp = re.compile(r"(\\[{}]|\n|\\[^\s\\{}&]+(?:[ \t\r\f\v])?)") | def __compile_expressions(self): SIMPLE_RPL = { "\\\\": "\\backslash ", "\\~": "\\~ ", "\\;": "\\; ", "&": "&", "<": "<", ">": ">", "\\~": "\\~ ", "\\_": "\\_ ", "\\:": "\\: ", "\\-": "\\- ", # turn into a generic token to eliminate special # cases and make processing easier "\\{": "\\ob ", # turn into a generic token to eliminate special # cases and make processing easier "\\}": "\\cb ", # put a backslash in front of to eliminate special cases and # make processing easier "{": "\\{", # put a backslash in front of to eliminate special cases and # make processing easier "}": "\\}", # this is for older RTF r'\\$': '\\par ', } self.__replace_spchar = MReplace(SIMPLE_RPL) self.__ms_hex_exp = re.compile(r"\\\'([0-9a-fA-F]{2})") #r"\\\'(..)" self.__utf_exp = re.compile(r"\\u(-?\d{3,6}) {0,1}") #modify this #self.__utf_exp = re.compile(r"^\\u(-?\d{3,6})") #add \n in split for whole file reading #self.__splitexp = re.compile(r"(\\[\\{}]|{|}|\n|\\[^\s\\{}&]+(?:\s)?)") #why keep backslash whereas \is replaced before? self.__splitexp = re.compile(r"(\\[{}]|\n|\\[^\s\\{}&]+(?:[ \t\r\f\v])?)") #self.__par_exp = re.compile(r'\\$') #self.__remove_line = re.compile(r'\n+') #self.__mixed_exp = re.compile(r"(\\[a-zA-Z]+\d+)(\D+)") ##self.num_exp = re.compile(r"(\*|:|[a-zA-Z]+)(.*)") | 7c70914ad30fc358bfcd7c099494b0a43682ba27 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9125/7c70914ad30fc358bfcd7c099494b0a43682ba27/tokenize.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
11100,
67,
21480,
12,
2890,
4672,
19098,
67,
54,
6253,
273,
288,
28040,
21392,
8422,
823,
12877,
3104,
8422,
98,
6877,
8422,
98,
3104,
8422,
4868,
30,
8422,
31,
3104,
7830,
6877,
7... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
11100,
67,
21480,
12,
2890,
4672,
19098,
67,
54,
6253,
273,
288,
28040,
21392,
8422,
823,
12877,
3104,
8422,
98,
6877,
8422,
98,
3104,
8422,
4868,
30,
8422,
31,
3104,
7830,
6877,
7... |
"""The method aims generally at MoinMoin.parser.text_xslt This parser should encode Unicode input to UTF8 as late as possible | """ This method aims generally at MoinMoin.parser.text_xslt - this parser should encode Unicode input to UTF8 as late as possible. | def test_ParserOutput(self): """The method aims generally at MoinMoin.parser.text_xslt This parser should encode Unicode input to UTF8 as late as possible """ request = self.request assert not request.cfg.allow_xslt, u'allow_xslt should be disabled' errmsg = [] | ce8a961b19e148ce28f006648a0021e13c16f358 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/888/ce8a961b19e148ce28f006648a0021e13c16f358/test_unicode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2678,
1447,
12,
2890,
4672,
3536,
1220,
707,
279,
12097,
19190,
622,
490,
885,
49,
885,
18,
4288,
18,
955,
67,
92,
14414,
300,
333,
2082,
1410,
2017,
9633,
810,
358,
6380,
28... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
2678,
1447,
12,
2890,
4672,
3536,
1220,
707,
279,
12097,
19190,
622,
490,
885,
49,
885,
18,
4288,
18,
955,
67,
92,
14414,
300,
333,
2082,
1410,
2017,
9633,
810,
358,
6380,
28... |
commands = re.split('[\n;]+', commands) | commands = commands.split(';') | def _filterUnrecognizedCommands(self, commands): assert isinstance(commands, str) result = [ ] #commands = commands.replace('\n', ';').replace(';', ';*').strip('*') #for comm in commands.split('*'): commands = re.split('[\n;]+', commands) for comm in commands: if comm: ## if not an empty string. if self._isHPGLCommandKnown(comm): #result.append(comm) result.append(comm + ';') else: print 'WARNING: HPGL command "%s" not recognized by %s.'\ % (comm, self.type), print 'Command not sent.' return ''.join(result) | 5121198ae2c935055ee4ff6b188f1dbca9b7f6e8 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3716/5121198ae2c935055ee4ff6b188f1dbca9b7f6e8/baseplotter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
19648,
9127,
12,
2890,
16,
4364,
4672,
1815,
1549,
12,
7847,
16,
609,
13,
563,
273,
306,
308,
468,
7847,
273,
4364,
18,
2079,
2668,
64,
82,
2187,
7554,
2934,
2079,
2668,
31,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2188,
19648,
9127,
12,
2890,
16,
4364,
4672,
1815,
1549,
12,
7847,
16,
609,
13,
563,
273,
306,
308,
468,
7847,
273,
4364,
18,
2079,
2668,
64,
82,
2187,
7554,
2934,
2079,
2668,
31,... |
def contains(self, path, suffix=None): """Check, whether the file in ``path`` is already cached. """ return self.getCachedFile(path, suffix=suffix) is not None | def contains(self, path=None, marker=None, suffix=None): """Check, whether the file in ``path`` or marked by ``marker`` and with suffix ``suffix`` is already cached. This is a convenience method for easy checking of caching state for certain files. You can also get the information by using other API methods of :class:`CacheManager`. You must at least give one of ``path`` or ``marker``, not both. The ``suffix`` parameter is optional. Returns ``True`` or ``False``. """ if path is None and marker is None: raise TypeError( "contains() takes at least one of `path' or `marker'") if path is not None and marker is not None: raise TypeError( "contains() takes only one of `path' or `marker', not both") result_path = None if marker is not None: result_path = self.getCachedFileFromMarker(marker, suffix=suffix) else: result_path = self.getCachedFile(path, suffix=suffix) return result_path is not None | def contains(self, path, suffix=None): """Check, whether the file in ``path`` is already cached. """ return self.getCachedFile(path, suffix=suffix) is not None | 6784e69cc899d53f8b6bb324d2142feb64f03fa6 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9481/6784e69cc899d53f8b6bb324d2142feb64f03fa6/cachemanager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1914,
12,
2890,
16,
589,
16,
3758,
33,
7036,
4672,
3536,
1564,
16,
2856,
326,
585,
316,
12176,
803,
10335,
353,
1818,
3472,
18,
3536,
327,
365,
18,
588,
9839,
812,
12,
803,
16,
3758,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1914,
12,
2890,
16,
589,
16,
3758,
33,
7036,
4672,
3536,
1564,
16,
2856,
326,
585,
316,
12176,
803,
10335,
353,
1818,
3472,
18,
3536,
327,
365,
18,
588,
9839,
812,
12,
803,
16,
3758,
... |
if 'real_mpfi' in base: print base | def need_to_cython(deps, filename, outfile): """ INPUT: filename -- The name of a cython file in the SAGE source tree. outfile -- The name of the corresponding c or cpp file in the build directory. OUTPUT: bool -- whether or not outfile must be regenerated. """ base = os.path.splitext(filename)[0] pxd = base+'.pxd' if 'real_mpfi' in base: print base if need_to_build(deps, filename, outfile): return True elif os.path.exists(pxd) and need_to_build(deps, pxd, outfile): return True else: return False | 8f60ed11740996e6d4c2c12e1a35faf0dabee362 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/8f60ed11740996e6d4c2c12e1a35faf0dabee362/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1608,
67,
869,
67,
2431,
3041,
12,
14877,
16,
1544,
16,
8756,
4672,
3536,
12943,
30,
1544,
1493,
1021,
508,
434,
279,
6143,
3041,
585,
316,
326,
348,
2833,
1084,
2151,
18,
8756,
1493,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1608,
67,
869,
67,
2431,
3041,
12,
14877,
16,
1544,
16,
8756,
4672,
3536,
12943,
30,
1544,
1493,
1021,
508,
434,
279,
6143,
3041,
585,
316,
326,
348,
2833,
1084,
2151,
18,
8756,
1493,
... | |
debug('Setting socket on '+str(args.port)) messages.put('start') server = ThreadedTCPServer(('localhost', int(args.port)), ThreadedTCPRequestHandler) server_thread = threading.Thread(target=server.serve_forever) server_thread.setDaemon(True) server_thread.start() debug("Server running in thread:"+str(server_thread.getName())) debug('Opening interface for sniffing') cap = pcapy.open_live(args.interface, 1500, 0, 0) if pcapy.DLT_EN10MB != cap.datalink(): print "Interface is not ethernet based. Quitting..." sys.exit(1) print "%s: net=%s, mask=%s, addrs=%s" % (args.interface, cap.getnet(), cap.getmask(), str(ipAddresses)) debug('Setting filter') cap.setfilter('tcp[13] = 2 ') debug('Waiting for packet...') (header, payload) = cap.next() while header: rip = ImpactDecoder.EthDecoder().decode(payload) macAddr = rip.as_eth_addr(rip.get_ether_shost()); dstAddr = rip.child().get_ip_dst() srcAddr = rip.child().get_ip_src() srcPort = str(rip.child().child().get_th_sport()) dstPort = str(rip.child().child().get_th_dport()) message = srcAddr+":"+srcPort+"->"+dstAddr+":"+dstPort print message messages.put(message) (header, payload) = cap.next() | debug('Starting tcpServer thread') tcpServer_thread = threading.Thread(target=tcpServer, args=('localhost',int(args.port), MAX_CLIENTS)) tcpServer_thread.setDaemon(True) tcpServer_thread.start() debug("tcpServer running in thread:"+str(tcpServer_thread.getName())) debug('Starting netMon thread') netMon_thread = threading.Thread(target=netMon, args=(args.interface, ipAddresses)) netMon_thread.setDaemon(True) netMon_thread.start() debug("netMon running in thread:"+str(netMon_thread.getName())) while True: time.sleep(10) print '.' | def checkInterface(iface): ipAddresses = [] # check if there are interfaces available with pcapy ifs = pcapy.findalldevs() if 0 == len(ifs): print "No interfaces available." sys.exit(1) if not iface in ifs: print "Interface '%s' not found." % (iface) sys.exit(1) for ifaceName in netifaces.interfaces(): try: addresses = netifaces.ifaddresses(ifaceName)[netifaces.AF_INET] for address in netifaces.ifaddresses(ifaceName)[netifaces.AF_INET]: if iface == 'any': ipAddresses.append(address['addr']) elif iface == ifaceName: ipAddresses.append(address['addr']) except KeyError: if iface == ifaceName: print "Interface '%s' is down." % (iface) sys.exit(1) return ipAddresses | ddca5a6d922024f2741df59d888c45fb81357ef3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2895/ddca5a6d922024f2741df59d888c45fb81357ef3/xpcapy.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
1358,
12,
31479,
4672,
2359,
7148,
273,
5378,
225,
468,
866,
309,
1915,
854,
7349,
2319,
598,
293,
5909,
93,
309,
87,
273,
293,
5909,
93,
18,
4720,
454,
5206,
87,
1435,
309,
374,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1358,
12,
31479,
4672,
2359,
7148,
273,
5378,
225,
468,
866,
309,
1915,
854,
7349,
2319,
598,
293,
5909,
93,
309,
87,
273,
293,
5909,
93,
18,
4720,
454,
5206,
87,
1435,
309,
374,
... |
info['path'] = factory.__module__ + '.SimpleViewClass' info['template'] = factory.index.filename | base = factory.__bases__[0] info['path'] = base.__module__ + '.' + base.__name__ info['template'] = factory.index.filename.replace(BASEDIR, 'Zope3') | def _getFactoryData(factory): """Squeeze some useful information out of the view factory Examples:: >>> from tests import pprintDict The factory is a SimpleViewClass for a Page Template: >>> from zope.app.pagetemplate.simpleviewclass import SimpleViewClass >>> view = SimpleViewClass('index.pt') >>> info = _getFactoryData(view) >>> pprintDict(info) [('path', 'zope.app.pagetemplate.simpleviewclass.SimpleViewClass'), ('referencable', False), ('resource', None), ('template', '/opt/zope/Zope3/Zope3-Fresh/src/zope/app/apidoc/viewmodule/index.pt'), ('url', None)] The factory is a simple type: >>> info = _getFactoryData(3) >>> pprintDict(info) [('path', None), ('referencable', False), ('resource', None), ('template', None), ('url', None)] The factory is an instance: >>> class Factory(object): ... pass >>> info = _getFactoryData(Factory()) >>> pprintDict(info) [('path', 'zope.app.apidoc.viewmodule.browser.Factory'), ('referencable', True), ('resource', None), ('template', None), ('url', 'zope/app/apidoc/viewmodule/browser/Factory')] The factory is a class or type: >>> info = _getFactoryData(Factory) >>> pprintDict(info) [('path', 'zope.app.apidoc.viewmodule.browser.Factory'), ('referencable', True), ('resource', None), ('template', None), ('url', 'zope/app/apidoc/viewmodule/browser/Factory')] """ info = {'path': None, 'url': None, 'template': None, 'resource': None, 'referencable': False} if hasattr(factory, '__name__') and \ factory.__name__.startswith('SimpleViewClass'): info['path'] = factory.__module__ + '.SimpleViewClass' info['template'] = factory.index.filename elif isinstance(factory, (str, unicode, float, int, list, tuple)): pass elif factory.__module__.startswith('zope.app.publisher.browser.viewmeta'): info['path'] = getPythonPath(factory.__bases__[0]) info['referencable'] = True elif hasattr(factory, '__name__') and factory.__name__ == 'proxyView': info['path'] = factory.__module__ + '.proxyView' elif not hasattr(factory, '__name__'): info['path'] = getPythonPath(factory.__class__) info['referencable'] = True elif type(factory) in (type, ClassType): info['path'] = getPythonPath(factory) info['referencable'] = True else: info['path'] = getPythonPath(factory) info['referencable'] = True if info['referencable']: info['url'] = info['path'].replace('.', '/') if isinstance(factory, IconViewFactory): info['resource'] = factory.rname return info | df7be39d25de4f8aadd28cfa19fc9a7006abcbe0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9672/df7be39d25de4f8aadd28cfa19fc9a7006abcbe0/browser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
1733,
751,
12,
6848,
4672,
3536,
55,
14652,
2690,
5301,
1779,
596,
434,
326,
1476,
3272,
225,
19830,
2866,
225,
4080,
628,
7434,
1930,
18771,
5014,
225,
1021,
3272,
353,
279,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
588,
1733,
751,
12,
6848,
4672,
3536,
55,
14652,
2690,
5301,
1779,
596,
434,
326,
1476,
3272,
225,
19830,
2866,
225,
4080,
628,
7434,
1930,
18771,
5014,
225,
1021,
3272,
353,
279,
4... |
print "Character", `c` | if DEBUG: print "Character", `c` | def do_char(self, c, event): print "Character", `c` | a67a39b61261e14a924785aee0199e094d466e35 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/a67a39b61261e14a924785aee0199e094d466e35/FrameWork.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3001,
12,
2890,
16,
276,
16,
871,
4672,
309,
6369,
30,
1172,
315,
7069,
3113,
1375,
71,
68,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
741,
67,
3001,
12,
2890,
16,
276,
16,
871,
4672,
309,
6369,
30,
1172,
315,
7069,
3113,
1375,
71,
68,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
summary = ' <i>No Summary</i>' | summary = ' <i>%s</i>' % _('No Summary') | def render_data(self, review_request): summary = conditional_escape(review_request.summary) if not summary: summary = ' <i>No Summary</i>' | b9dbc8ec37d1f9e045b9a7a281fa98e33d789b4c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1600/b9dbc8ec37d1f9e045b9a7a281fa98e33d789b4c/datagrids.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1743,
67,
892,
12,
2890,
16,
10725,
67,
2293,
4672,
4916,
273,
11139,
67,
6939,
12,
16041,
67,
2293,
18,
7687,
13,
309,
486,
4916,
30,
4916,
273,
5183,
10600,
31,
32,
77,
34,
2279,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1743,
67,
892,
12,
2890,
16,
10725,
67,
2293,
4672,
4916,
273,
11139,
67,
6939,
12,
16041,
67,
2293,
18,
7687,
13,
309,
486,
4916,
30,
4916,
273,
5183,
10600,
31,
32,
77,
34,
2279,
1... |
self.table.showColumn(i+1) self.table.adjustColumn(i+1) if self.ShowAttributeMethod == 1: | self.table.showColumn(i) self.table.adjustColumn(i) else: | def updateAttributes(self): if self.ShowAttributeMethod == 0: for i in range(len(self.data.domain.attributes)): self.table.showColumn(i+1) self.table.adjustColumn(i+1) if self.ShowAttributeMethod == 1: for i in range(len(self.data.domain.attributes)): self.table.hideColumn(i+1) | 63e34d56e155a4f1aba288f36a71868771294735 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6366/63e34d56e155a4f1aba288f36a71868771294735/OWPredictions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
2498,
12,
2890,
4672,
309,
365,
18,
5706,
1499,
1305,
422,
374,
30,
364,
277,
316,
1048,
12,
1897,
12,
2890,
18,
892,
18,
4308,
18,
4350,
3719,
30,
365,
18,
2121,
18,
4500,
149... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2498,
12,
2890,
4672,
309,
365,
18,
5706,
1499,
1305,
422,
374,
30,
364,
277,
316,
1048,
12,
1897,
12,
2890,
18,
892,
18,
4308,
18,
4350,
3719,
30,
365,
18,
2121,
18,
4500,
149... |
"""returns dict with package information""" | """returns dict with file information""" | def getFileData(self, id): """returns dict with package information""" pyfile = self.getFile(id) return pyfile.toDbDict() | e8d16afeface794da67131d9a37cbfe15b2142aa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9838/e8d16afeface794da67131d9a37cbfe15b2142aa/FileDatabase.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6034,
751,
12,
2890,
16,
612,
4672,
3536,
6154,
2065,
598,
585,
1779,
8395,
2395,
768,
273,
365,
18,
29925,
12,
350,
13,
225,
327,
2395,
768,
18,
869,
4331,
5014,
1435,
225,
2,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6034,
751,
12,
2890,
16,
612,
4672,
3536,
6154,
2065,
598,
585,
1779,
8395,
2395,
768,
273,
365,
18,
29925,
12,
350,
13,
225,
327,
2395,
768,
18,
869,
4331,
5014,
1435,
225,
2,
-100,
... |
rawgreenlet._joinall(alive, polling_period=polling_period) | rawgreenlet.joinall(alive, polling_period=polling_period) | def killall(sources, exception=ProcExit, block=False, polling_period=0.2): waiter = hub.Waiter() core.active_event(rawgreenlet._killall, sources, exception, waiter) if block: alive = waiter.wait() if alive: try: joinall(alive, trap_errors=True) except TypeError: rawgreenlet._joinall(alive, polling_period=polling_period) # QQQ a) use links for all the greenlets we can and poll the others # QQQ b) have only one unversal version of killall, waitall, joinall etc # QQQ the current dichotomy of greenlets and procs is confusing | 75da912c3abf538645fc4e2fbeb45146f8f7a69a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10423/75da912c3abf538645fc4e2fbeb45146f8f7a69a/proc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
454,
12,
10141,
16,
1520,
33,
15417,
6767,
16,
1203,
33,
8381,
16,
13708,
67,
6908,
33,
20,
18,
22,
4672,
17522,
273,
11891,
18,
5480,
264,
1435,
2922,
18,
3535,
67,
2575,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8673,
454,
12,
10141,
16,
1520,
33,
15417,
6767,
16,
1203,
33,
8381,
16,
13708,
67,
6908,
33,
20,
18,
22,
4672,
17522,
273,
11891,
18,
5480,
264,
1435,
2922,
18,
3535,
67,
2575,
12,
... |
found_docstring = False | def visitModule(self, node): stmt = node.node found_docstring = False for s in stmt.nodes: # Skip over docstrings if not found_docstring and isinstance(s, ast.Discard) \ and isinstance(s.expr, ast.Const) \ and isinstance(s.expr.value, str): found_docstring = True continue if not self.check_stmt(s): break | afcd838f1f69fdd4bf8a9e5799e0bd591fb109aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/afcd838f1f69fdd4bf8a9e5799e0bd591fb109aa/future.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
3120,
12,
2890,
16,
756,
4672,
3480,
273,
756,
18,
2159,
364,
272,
316,
3480,
18,
4690,
30,
468,
6611,
1879,
997,
10219,
309,
486,
1392,
67,
24675,
471,
1549,
12,
87,
16,
3364,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3757,
3120,
12,
2890,
16,
756,
4672,
3480,
273,
756,
18,
2159,
364,
272,
316,
3480,
18,
4690,
30,
468,
6611,
1879,
997,
10219,
309,
486,
1392,
67,
24675,
471,
1549,
12,
87,
16,
3364,
... | |
raise wikipedia.NoUsername(u'ERROR: Username for %s:%s is undefined.\nIf you have an account for that site, please add such a line to user-config.py:\n\nusernames[\'%s\'][\'%s\'] = \'myUsername\'' % (self.site.family.name, self.site.lang, self.site.family.name, self.site.lang)) | raise pywikibot.NoUsername(u'ERROR: Username for %s:%s is undefined.\nIf you have an account for that site, please add such a line to user-config.py:\n\nusernames[\'%s\'][\'%s\'] = \'myUsername\'' % (self.site.family.name, self.site.lang, self.site.family.name, self.site.lang)) | def __init__(self, password=None, sysop=False, site=None, username=None, verbose=False): self.site = site or wikipedia.getSite() self.sysop = sysop if username: self.username = username # perform writeback. if site.family.name not in config.usernames: config.usernames[site.family.name]={} config.usernames[site.family.name][self.site.lang]=username else: if sysop: try: self.username = config.sysopnames\ [self.site.family.name][self.site.lang] except: raise wikipedia.NoUsername(u'ERROR: Sysop username for %s:%s is undefined.\nIf you have a sysop account for that site, please add such a line to user-config.py:\n\nsysopnames[\'%s\'][\'%s\'] = \'myUsername\'' % (self.site.family.name, self.site.lang, self.site.family.name, self.site.lang)) else: try: self.username = config.usernames[self.site.family.name][self.site.lang] except: raise wikipedia.NoUsername(u'ERROR: Username for %s:%s is undefined.\nIf you have an account for that site, please add such a line to user-config.py:\n\nusernames[\'%s\'][\'%s\'] = \'myUsername\'' % (self.site.family.name, self.site.lang, self.site.family.name, self.site.lang)) self.password = password self.verbose = verbose if getattr(config, 'password_file', ''): self.readPassword() | 608981a1811e769d811dd6211e35a67e7339add5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/608981a1811e769d811dd6211e35a67e7339add5/login.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2201,
33,
7036,
16,
2589,
556,
33,
8381,
16,
2834,
33,
7036,
16,
2718,
33,
7036,
16,
3988,
33,
8381,
4672,
365,
18,
4256,
273,
2834,
578,
21137,
18,
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,
1001,
2738,
972,
12,
2890,
16,
2201,
33,
7036,
16,
2589,
556,
33,
8381,
16,
2834,
33,
7036,
16,
2718,
33,
7036,
16,
3988,
33,
8381,
4672,
365,
18,
4256,
273,
2834,
578,
21137,
18,
58... |
set_module_config('named_reader', config) | interface.set_module_config('named_reader', config) | def main(): print "hello from offline DeVIDE!" meta_modules = load_and_realise_network('/complete/path/to/dvnfile.dvn') # 1. First we are going to configure the reader module to load the file we want. # you can get and change the config of any module that you have named in a previous # DeVIDE session with right click | rename module. # a. get the configuration config = get_module_config('named_reader') # b. change the configuration config._filename = 'some_data_file.vti' # c. set he configuration back into the module set_module_config('named_reader', config) # after having setup more modules (for example the module writing the output of your # network), run the network. execute_network() # you could now repeat the process for other filenames or even other # networks. You can also make use of any Python niceties! | 1b0921a8357d31d15ef61f1a6dea3912475e7570 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4494/1b0921a8357d31d15ef61f1a6dea3912475e7570/example_offline_driver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1172,
315,
23711,
628,
13493,
1505,
58,
10385,
4442,
2191,
67,
6400,
273,
1262,
67,
464,
67,
7688,
784,
67,
5185,
2668,
19,
6226,
19,
803,
19,
869,
19,
15679,
82,
768,
18,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
1172,
315,
23711,
628,
13493,
1505,
58,
10385,
4442,
2191,
67,
6400,
273,
1262,
67,
464,
67,
7688,
784,
67,
5185,
2668,
19,
6226,
19,
803,
19,
869,
19,
15679,
82,
768,
18,... |
def dumps(params, methodname=None, methodresponse=None, encoding=None): | def dumps(params, methodname=None, methodresponse=None, encoding=None, allow_none=0): | def dumps(params, methodname=None, methodresponse=None, encoding=None): """data [,options] -> marshalled data Convert an argument tuple or a Fault instance to an XML-RPC request (or response, if the methodresponse option is used). In addition to the data object, the following options can be given as keyword arguments: methodname: the method name for a methodCall packet methodresponse: true to create a methodResponse packet. If this option is used with a tuple, the tuple must be a singleton (i.e. it can contain only one element). encoding: the packet encoding (default is UTF-8) All 8-bit strings in the data structure are assumed to use the packet encoding. Unicode strings are automatically converted, where necessary. """ assert isinstance(params, TupleType) or isinstance(params, Fault),\ "argument must be tuple or Fault instance" if isinstance(params, Fault): methodresponse = 1 elif methodresponse and isinstance(params, TupleType): assert len(params) == 1, "response tuple must be a singleton" if not encoding: encoding = "utf-8" if FastMarshaller: m = FastMarshaller(encoding) else: m = Marshaller(encoding) data = m.dumps(params) if encoding != "utf-8": xmlheader = "<?xml version='1.0' encoding='%s'?>\n" % str(encoding) else: xmlheader = "<?xml version='1.0'?>\n" # utf-8 is default # standard XML-RPC wrappings if methodname: # a method call if not isinstance(methodname, StringType): methodname = methodname.encode(encoding) data = ( xmlheader, "<methodCall>\n" "<methodName>", methodname, "</methodName>\n", data, "</methodCall>\n" ) elif methodresponse: # a method response, or a fault structure data = ( xmlheader, "<methodResponse>\n", data, "</methodResponse>\n" ) else: return data # return as is return string.join(data, "") | 3172d26d432bb314fb46e82b3a2e569dfa5001ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/3172d26d432bb314fb46e82b3a2e569dfa5001ae/xmlrpclib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6711,
12,
2010,
16,
707,
529,
33,
7036,
16,
707,
2740,
33,
7036,
16,
2688,
33,
7036,
16,
1699,
67,
6102,
33,
20,
4672,
3536,
892,
306,
16,
2116,
65,
317,
10893,
1259,
501,
225,
4037,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6711,
12,
2010,
16,
707,
529,
33,
7036,
16,
707,
2740,
33,
7036,
16,
2688,
33,
7036,
16,
1699,
67,
6102,
33,
20,
4672,
3536,
892,
306,
16,
2116,
65,
317,
10893,
1259,
501,
225,
4037,... |
if (e is not exc and type(e) is not exc): | if type(e) is not exc: | def testAttributes(self): # test that exception attributes are happy try: str(u'Hello \u00E1') except Exception, e: sampleUnicodeEncodeError = e | d6d9d619b7a4c6e74547b9119fea0df07783ba71 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/d6d9d619b7a4c6e74547b9119fea0df07783ba71/test_exceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2498,
12,
2890,
4672,
468,
1842,
716,
1520,
1677,
854,
5622,
2074,
775,
30,
609,
12,
89,
11,
18601,
521,
89,
713,
41,
21,
6134,
1335,
1185,
16,
425,
30,
3296,
16532,
5509,
668,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
2498,
12,
2890,
4672,
468,
1842,
716,
1520,
1677,
854,
5622,
2074,
775,
30,
609,
12,
89,
11,
18601,
521,
89,
713,
41,
21,
6134,
1335,
1185,
16,
425,
30,
3296,
16532,
5509,
668,
... |
rpms = findRpms(d) | rpms = findRpms(d, ignoresymlinks) | def checkSrpms(): directories = [ "/var/www/html/mirror/updates-rhel/2.1", "/var/www/html/mirror/updates-rhel/3", "/var/www/html/mirror/updates-rhel/4", "/mnt/hdb4/data/cAos/3.5/updates/SRPMS", "/home/mirror/centos/3.6/updates/SRPMS", "/mnt/hdb4/data/cAos/4.1/os/SRPMS", "/mnt/hdb4/data/cAos/4.1/updates/SRPMS", "/home/mirror/centos/4.2/os/SRPMS", "/home/mirror/centos/4.2/updates/SRPMS", "/home/mirror/scientific/SRPMS/vendor/errata", "/home/mirror/scientific/SRPMS/vendor/original", "/home/mirror/scientific/SRPMS"] for d in directories: if not os.path.isdir(d): continue rpms = findRpms(d) rpms = readRpm(rpms, rpmsigtag, rpmtag) h = {} for rpm in rpms: h.setdefault(rpm["name"], []).append(rpm) for v in h.values(): v.sort(pkgCompare) for i in xrange(len(v) - 1): if v[i].hdr.getOne("buildtime") > \ v[i + 1].hdr.getOne("buildtime"): print "buildtime inversion:", v[i].filename, \ v[i + 1].filename directories.append("/var/www/html/mirror/rhn/SRPMS") rpms = [] for d in directories: if os.path.isdir(d): rpms.extend(findRpms(d)) rpms = readRpm(rpms, rpmsigtag, rpmtag) h = {} for rpm in rpms: h.setdefault(rpm["name"], []).append(rpm) for v in h.values(): v.sort(pkgCompare) i = 0 while i < len(v) - 1: if pkgCompare(v[i], v[i + 1]) == 0: if not sameSrcRpm(v[i], v[i + 1]): print "duplicate rpms:", v[i].filename, v[i + 1].filename v.remove(v[i]) else: i += 1 | 5af1a9ab2d3fc26ec4980dbba8ae98a457986a26 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/5af1a9ab2d3fc26ec4980dbba8ae98a457986a26/oldpyrpm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
55,
13832,
959,
13332,
6402,
273,
306,
2206,
1401,
19,
5591,
19,
2620,
19,
27197,
19,
14703,
17,
30138,
292,
19,
22,
18,
21,
3113,
2206,
1401,
19,
5591,
19,
2620,
19,
27197,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
55,
13832,
959,
13332,
6402,
273,
306,
2206,
1401,
19,
5591,
19,
2620,
19,
27197,
19,
14703,
17,
30138,
292,
19,
22,
18,
21,
3113,
2206,
1401,
19,
5591,
19,
2620,
19,
27197,
19,
... |
self.moviePlayAction.setIconSet(QIconSet(self.image102)) | self.moviePlayAction.setIconSet(QIconSet(self.image98)) | 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... |
with test_support.EnvironmentVarGuard() as environ: | with support.EnvironmentVarGuard() as environ: | def test_uname_win32_ARCHITEW6432(self): # Issue 7860: make sure we get architecture from the correct variable # on 64 bit Windows: if PROCESSOR_ARCHITEW6432 exists we should be # using it, per # http://blogs.msdn.com/david.wang/archive/2006/03/26/HOWTO-Detect-Process-Bitness.aspx try: with test_support.EnvironmentVarGuard() as environ: if 'PROCESSOR_ARCHITEW6432' in environ: del environ['PROCESSOR_ARCHITEW6432'] environ['PROCESSOR_ARCHITECTURE'] = 'foo' platform._uname_cache = None system, node, release, version, machine, processor = platform.uname() self.assertEqual(machine, 'foo') environ['PROCESSOR_ARCHITEW6432'] = 'bar' platform._uname_cache = None system, node, release, version, machine, processor = platform.uname() self.assertEqual(machine, 'bar') finally: platform._uname_cache = None | a799f4ebe4bb39f99f6a8d6bd2ef36fffecb3977 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/a799f4ebe4bb39f99f6a8d6bd2ef36fffecb3977/test_platform.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
318,
339,
67,
8082,
1578,
67,
10586,
5398,
59,
1105,
1578,
12,
2890,
4672,
468,
11820,
22860,
4848,
30,
1221,
3071,
732,
336,
27418,
628,
326,
3434,
2190,
468,
603,
5178,
2831,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
318,
339,
67,
8082,
1578,
67,
10586,
5398,
59,
1105,
1578,
12,
2890,
4672,
468,
11820,
22860,
4848,
30,
1221,
3071,
732,
336,
27418,
628,
326,
3434,
2190,
468,
603,
5178,
2831,... |
s = shelve.open(self.fn, protocol=0) | def test_ascii_file_shelf(self): try: s = shelve.open(self.fn, protocol=0) s['key1'] = (1,2,3,4) self.assertEqual(s['key1'], (1,2,3,4)) s.close() finally: for f in glob.glob(self.fn+"*"): os.unlink(f) | 8d9db047d2dde9a36197449bd66ea8b0dc42286d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/8d9db047d2dde9a36197449bd66ea8b0dc42286d/test_shelve.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9184,
67,
768,
67,
674,
19079,
12,
2890,
4672,
775,
30,
272,
3292,
856,
21,
3546,
273,
261,
21,
16,
22,
16,
23,
16,
24,
13,
365,
18,
11231,
5812,
12,
87,
3292,
856,
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,
1842,
67,
9184,
67,
768,
67,
674,
19079,
12,
2890,
4672,
775,
30,
272,
3292,
856,
21,
3546,
273,
261,
21,
16,
22,
16,
23,
16,
24,
13,
365,
18,
11231,
5812,
12,
87,
3292,
856,
21,
... | |
if cvs_root is None: | if vcs_root is None: | def ProcessFile(self, file): """Dump symbols from this file into a symbol file, stored in the proper directory structure in |symbol_path|.""" result = False sourceFileStream = '' # tries to get cvsroot from the .mozconfig first - if it's not set # the tinderbox cvs_path will be assigned further down cvs_root = os.environ.get("SRCSRV_ROOT") for arch in self.archs: try: cmd = os.popen("%s %s %s" % (self.dump_syms, arch, file), "r") module_line = cmd.next() if module_line.startswith("MODULE"): # MODULE os cpu guid debug_file (guid, debug_file) = (module_line.split())[3:5] # strip off .pdb extensions, and append .sym sym_file = re.sub("\.pdb$", "", debug_file) + ".sym" # we do want forward slashes here rel_path = os.path.join(debug_file, guid, sym_file).replace("\\", "/") full_path = os.path.normpath(os.path.join(self.symbol_path, rel_path)) try: os.makedirs(os.path.dirname(full_path)) except OSError: # already exists pass f = open(full_path, "w") f.write(module_line) # now process the rest of the output for line in cmd: if line.startswith("FILE"): # FILE index filename (x, index, filename) = line.split(None, 2) if sys.platform == "sunos5": start = filename.find(self.srcdir) if start == -1: start = 0 filename = filename[start:] filename = self.FixFilenameCase(filename.rstrip()) sourcepath = filename if self.vcsinfo: (filename, rootname) = GetVCSFilename(filename, self.srcdir) # sets cvs_root in case the loop through files were to end on an empty rootname if cvs_root is None: if rootname: cvs_root = rootname # gather up files with cvs for indexing if filename.startswith("cvs"): (ver, checkout, source_file, revision) = filename.split(":", 3) sourceFileStream += sourcepath + "*MYSERVER*" + source_file + '*' + revision + "\r\n" f.write("FILE %s %s\n" % (index, filename)) else: # pass through all other lines unchanged f.write(line) f.close() cmd.close() # we output relative paths so callers can get a list of what # was generated print rel_path if self.copy_debug: self.CopyDebug(file, debug_file, guid) if self.srcsrv: # Call on SourceServerIndexing result = self.SourceServerIndexing(debug_file, guid, sourceFileStream, cvs_root) result = True except StopIteration: pass except: print >> sys.stderr, "Unexpected error: ", sys.exc_info()[0] raise return result | 1ec1c8b7a3180f04f0cb608e3800b1f5b51fb09f /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/1ec1c8b7a3180f04f0cb608e3800b1f5b51fb09f/symbolstore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4389,
812,
12,
2890,
16,
585,
4672,
3536,
10628,
7963,
628,
333,
585,
1368,
279,
3273,
585,
16,
4041,
316,
326,
5338,
1867,
3695,
316,
225,
571,
7175,
67,
803,
96,
12123,
563,
273,
108... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4389,
812,
12,
2890,
16,
585,
4672,
3536,
10628,
7963,
628,
333,
585,
1368,
279,
3273,
585,
16,
4041,
316,
326,
5338,
1867,
3695,
316,
225,
571,
7175,
67,
803,
96,
12123,
563,
273,
108... |
self.lcov_converter_path = self.lcov_converter_path.rstrip('\\') convert_command = ('%s -sym_path=%s -src_root=%s ' % (os.path.join(self.lcov_converter_path, 'coverage_analyzer.exe'), | self.tools_path = self.tools_path.rstrip('\\') convert_command = ('%s -sym_path=%s -src_root=%s %s' % (os.path.join(self.tools_path, 'coverage_analyzer.exe'), | def Upload(self, coverage_file, upload_path, sym_path=None, src_root=None): """Upload the results to the dashboard. | bc410f64b906bf3a5ca7721d73b3632fcccaeae2 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9392/bc410f64b906bf3a5ca7721d73b3632fcccaeae2/coverage.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9414,
12,
2890,
16,
11196,
67,
768,
16,
3617,
67,
803,
16,
5382,
67,
803,
33,
7036,
16,
1705,
67,
3085,
33,
7036,
4672,
3536,
4777,
326,
1686,
358,
326,
11825,
18,
2,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
9414,
12,
2890,
16,
11196,
67,
768,
16,
3617,
67,
803,
16,
5382,
67,
803,
33,
7036,
16,
1705,
67,
3085,
33,
7036,
4672,
3536,
4777,
326,
1686,
358,
326,
11825,
18,
2,
-100,
-100,
-10... |
-K, --access-key - user's Access Key ID. -S, --secret-key - user's Secret Key. | -a, --access-key - user's Access Key ID. -s, --secret-key - user's Secret Key. | def make_fs(self, image_path): | 55e0562073d61d9f476724753a76a9b272a81ec6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12707/55e0562073d61d9f476724753a76a9b272a81ec6/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2556,
12,
2890,
16,
1316,
67,
803,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
2556,
12,
2890,
16,
1316,
67,
803,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.AddError('Subject line ignored:\n' + subject, trunc=0) | self.AddError('Subject line ignored:\n ' + subject) | def ParseMailCommands(self): | 5551c37235c9c603bd7ae608093198c4c4d929f5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/5551c37235c9c603bd7ae608093198c4c4d929f5/MailCommandHandler.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
6759,
9127,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2884,
6759,
9127,
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,
-... |
try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back | frame = sys._getframe().f_back | def set_trace(self): """Start debugging from here.""" try: raise Exception except: frame = sys.exc_info()[2].tb_frame.f_back self.reset() while frame: frame.f_trace = self.trace_dispatch self.botframe = frame frame = frame.f_back self.set_step() sys.settrace(self.trace_dispatch) | 046893f4de24e2c2209f986ab84c8f4d90f17c39 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/046893f4de24e2c2209f986ab84c8f4d90f17c39/bdb.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
67,
5129,
12,
2890,
4672,
3536,
1685,
10450,
628,
2674,
12123,
2623,
273,
2589,
6315,
588,
3789,
7675,
74,
67,
823,
365,
18,
6208,
1435,
1323,
2623,
30,
2623,
18,
74,
67,
5129,
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,
444,
67,
5129,
12,
2890,
4672,
3536,
1685,
10450,
628,
2674,
12123,
2623,
273,
2589,
6315,
588,
3789,
7675,
74,
67,
823,
365,
18,
6208,
1435,
1323,
2623,
30,
2623,
18,
74,
67,
5129,
27... |
buffer_balance = Decimal(str(float(buffer_category['balance'])+float(item_amount_over))) self.cur.execute("update ExpenseCategory set balance = :balance where id = 1", {'balance':str(buffer_balance)}) | buffer_balance = buffer_category_balance+item_amount_over self.cur.execute("update ExpenseCategory set balance = :balance where id = 1", {'balance':mf(buffer_balance)}) | def _update_category_balance(self, item): "Update the category balance from the item amount" if int(item['type']) == 1: table = "ExpenseCategory" elif int(item['type']) == 2: table = "BillCategory" elif int(item['type']) == 3: table = "SavingCategory" category_select = "select * from %s where id = :id;" % (table) category_update = "update %s set balance = :balance where id = :id;" % (table) | c1b405e7b76ee374ecb1e3fca3072ef6e0007414 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/14271/c1b405e7b76ee374ecb1e3fca3072ef6e0007414/view.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
67,
4743,
67,
12296,
12,
2890,
16,
761,
4672,
315,
1891,
326,
3150,
11013,
628,
326,
761,
3844,
6,
309,
509,
12,
1726,
3292,
723,
19486,
422,
404,
30,
1014,
273,
315,
424,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2725,
67,
4743,
67,
12296,
12,
2890,
16,
761,
4672,
315,
1891,
326,
3150,
11013,
628,
326,
761,
3844,
6,
309,
509,
12,
1726,
3292,
723,
19486,
422,
404,
30,
1014,
273,
315,
424,
... |
raise ParseError() | raise ParseError("Expected a name") | def parse_dotted_name_list(elt_list): """ If the given list of tree token elements contains a comma-separated list of dotted names, then return a corresponding list of L{DottedName} objects. Otherwise, raise ParseError. """ names = [] state = 0 for elt in elt_list: # State 0 -- Expecting a name, or end of arglist if state == 0: # Make sure it's a name if isinstance(elt, tuple) and elt[0] == token.NAME: names.append(DottedName(elt[1])) state = 1 else: raise ParseError() # State 1 -- Expecting comma, period, or end of arglist elif state == 1: if elt == (token.OP, '.'): state = 2 elif elt == (token.OP, ','): state = 0 else: raise ParseError() # State 2 -- Continuation of dotted name. elif state == 2: if isinstance(elt, tuple) and elt[0] == token.NAME: names[-1] = DottedName(names[-1], elt[1]) state = 1 else: raise ParseError() if state == 2: raise ParseError() return names | a3ef0fa18cbe7a3bcd10dd7313809fd187cded40 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/a3ef0fa18cbe7a3bcd10dd7313809fd187cded40/docparser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1109,
67,
9811,
2344,
67,
529,
67,
1098,
12,
20224,
67,
1098,
4672,
3536,
971,
326,
864,
666,
434,
2151,
1147,
2186,
1914,
279,
8716,
17,
24622,
666,
434,
20965,
1257,
16,
1508,
327,
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,
9811,
2344,
67,
529,
67,
1098,
12,
20224,
67,
1098,
4672,
3536,
971,
326,
864,
666,
434,
2151,
1147,
2186,
1914,
279,
8716,
17,
24622,
666,
434,
20965,
1257,
16,
1508,
327,
2... |
pat, val = pat.split(':', 1) if pat in ('re', 'glob', 'path', 'relglob', 'relpath', 'relre'): return pat, val | kind, val = pat.split(':', 1) if kind in ('re', 'glob', 'path', 'relglob', 'relpath', 'relre'): return kind, val | def _patsplit(pat, default): """Split a string into an optional pattern kind prefix and the actual pattern.""" if ':' in pat: pat, val = pat.split(':', 1) if pat in ('re', 'glob', 'path', 'relglob', 'relpath', 'relre'): return pat, val return default, pat | 16e1a1d5e53bf2f14ec3ecd7dec6c8a82adba0f5 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11312/16e1a1d5e53bf2f14ec3ecd7dec6c8a82adba0f5/match.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
84,
2323,
1127,
12,
16330,
16,
805,
4672,
3536,
5521,
279,
533,
1368,
392,
3129,
1936,
3846,
1633,
471,
326,
3214,
1936,
12123,
309,
3921,
316,
9670,
30,
3846,
16,
1244,
273,
9670,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
84,
2323,
1127,
12,
16330,
16,
805,
4672,
3536,
5521,
279,
533,
1368,
392,
3129,
1936,
3846,
1633,
471,
326,
3214,
1936,
12123,
309,
3921,
316,
9670,
30,
3846,
16,
1244,
273,
9670,
... |
def rawcommit(ui, repo, files, rc): | def rawcommit(ui, repo, files, **rc): | def rawcommit(ui, repo, files, rc): "raw commit interface" text = rc['text'] if not text and rc['logfile']: try: text = open(rc['logfile']).read() except IOError: pass if not text and not rc['logfile']: print "missing commit text" return 1 files = relpath(repo, files) if rc['files']: files += open(rc['files']).read().splitlines() repo.rawcommit(files, text, rc['user'], rc['date'], *rc['parent']) | ad3f8148b889fe9ba98a3fc93c7f9f13022adc8a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11312/ad3f8148b889fe9ba98a3fc93c7f9f13022adc8a/commands.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1831,
7371,
12,
4881,
16,
3538,
16,
1390,
16,
2826,
1310,
4672,
315,
1899,
3294,
1560,
6,
225,
977,
273,
4519,
3292,
955,
3546,
309,
486,
977,
471,
4519,
3292,
28806,
3546,
30,
775,
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,
1831,
7371,
12,
4881,
16,
3538,
16,
1390,
16,
2826,
1310,
4672,
315,
1899,
3294,
1560,
6,
225,
977,
273,
4519,
3292,
955,
3546,
309,
486,
977,
471,
4519,
3292,
28806,
3546,
30,
775,
30... |
if self.PunkBuster | if self.PunkBuster: | def connectClient(self, ccid): if self.PunkBuster self.debug('Getting the (PunkBuster) Playerlist') else: self.debug('Getting the (status) Playerlist') players = self.getPlayerList() self.verbose('connectClient() = %s' % players) | c921986bf67afb94988afc6f88ac321bca7600bc /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12909/c921986bf67afb94988afc6f88ac321bca7600bc/cod4.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
1227,
12,
2890,
16,
4946,
350,
4672,
309,
365,
18,
52,
1683,
38,
1722,
30,
365,
18,
4148,
2668,
19213,
326,
261,
52,
1683,
38,
1722,
13,
19185,
1098,
6134,
469,
30,
365,
18,
41... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3077,
1227,
12,
2890,
16,
4946,
350,
4672,
309,
365,
18,
52,
1683,
38,
1722,
30,
365,
18,
4148,
2668,
19213,
326,
261,
52,
1683,
38,
1722,
13,
19185,
1098,
6134,
469,
30,
365,
18,
41... |
Reviewer("David Hyatt", "hyatt@apple.com", "harrison"), | Reviewer("David Hyatt", "hyatt@apple.com", "hyatt"), | def __init__(self, name, email_or_emails, irc_nickname=None): Committer.__init__(self, name, email_or_emails, irc_nickname) self.can_review = True | 215d7353f8f1e2cce71a4f00422cba3bedd3855a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/215d7353f8f1e2cce71a4f00422cba3bedd3855a/committers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
2699,
67,
280,
67,
22762,
16,
277,
1310,
67,
17091,
529,
33,
7036,
4672,
10269,
387,
16186,
2738,
972,
12,
2890,
16,
508,
16,
2699,
67,
280,
6... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
508,
16,
2699,
67,
280,
67,
22762,
16,
277,
1310,
67,
17091,
529,
33,
7036,
4672,
10269,
387,
16186,
2738,
972,
12,
2890,
16,
508,
16,
2699,
67,
280,
6... |
for i in (2, 3, 4, 8): if last_indent + i == indent: last_indent_spaces = i indent_count[i] += 1; last_indent = indent break | indent_diff = abs(indent - last_indent) if indent_diff in (2, 3, 4, 8): last_indent_spaces = indent_diff indent_count[indent_diff] += 1; last_indent = indent | def auto_tab(self, doc, error, view): if error is not None: pass | 2911cc9f04b21f90c99ed91bdcc4be7f5f55ebca /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6065/2911cc9f04b21f90c99ed91bdcc4be7f5f55ebca/autotab.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3656,
67,
7032,
12,
2890,
16,
997,
16,
555,
16,
1476,
4672,
309,
555,
353,
486,
599,
30,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3656,
67,
7032,
12,
2890,
16,
997,
16,
555,
16,
1476,
4672,
309,
555,
353,
486,
599,
30,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
print 'checkin: ', row[0] | def get_next_id(cursor): """Calculate the next id to assign to new rows. This will be 1 higher than the max id for all tables in the DB. """ cursor.execute("SELECT name FROM sqlite_master " "WHERE type='table' and name != 'dtv_variables'") max_id = 0 for row in cursor.fetchall(): print 'checkin: ', row[0] cursor.execute("SELECT MAX(id) from %s" % row[0]) max_id = max(max_id, cursor.fetchone()[0]) return max_id + 1 | bb06d278e984236ff000b1b40fd9d76bd214f292 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12354/bb06d278e984236ff000b1b40fd9d76bd214f292/databaseupgrade.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4285,
67,
350,
12,
9216,
4672,
3536,
8695,
326,
1024,
612,
358,
2683,
358,
394,
2595,
18,
225,
1220,
903,
506,
404,
10478,
2353,
326,
943,
612,
364,
777,
4606,
316,
326,
2383,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
4285,
67,
350,
12,
9216,
4672,
3536,
8695,
326,
1024,
612,
358,
2683,
358,
394,
2595,
18,
225,
1220,
903,
506,
404,
10478,
2353,
326,
943,
612,
364,
777,
4606,
316,
326,
2383,... | |
The name of a tear-down function. This is called after running the | A tear-down function. This is called after running the | def DocFileSuite(*paths, **kw): """A unittest suite for one or more doctest files. The path to each doctest file is given as a string; the interpretation of that string depends on the keyword argument "module_relative". A number of options may be provided as keyword arguments: module_relative If "module_relative" is True, then the given file paths are interpreted as os-independent module-relative paths. By default, these paths are relative to the calling module's directory; but if the "package" argument is specified, then they are relative to that package. To ensure os-independence, "filename" should use "/" characters to separate path segments, and may not be an absolute path (i.e., it may not begin with "/"). If "module_relative" is False, then the given file paths are interpreted as os-specific paths. These paths may be absolute or relative (to the current working directory). package A Python package or the name of a Python package whose directory should be used as the base directory for module relative paths. If "package" is not specified, then the calling module's directory is used as the base directory for module relative filenames. It is an error to specify "package" if "module_relative" is False. setUp The name of a set-up function. This is called before running the tests in each file. The setUp function will be passed a DocTest object. The setUp function can access the test globals as the globs attribute of the test passed. tearDown The name of a tear-down function. This is called after running the tests in each file. The tearDown function will be passed a DocTest object. The tearDown function can access the test globals as the globs attribute of the test passed. globs A dictionary containing initial global variables for the tests. optionflags A set of doctest option flags expressed as an integer. """ suite = unittest.TestSuite() # We do this here so that _normalize_module is called at the right # level. If it were called in DocFileTest, then this function # would be the caller and we might guess the package incorrectly. if kw.get('module_relative', True): kw['package'] = _normalize_module(kw.get('package')) for path in paths: suite.addTest(DocFileTest(path, **kw)) return suite | 7a98ec2b175493f6fa830f03a8e0321d9cc58cf2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/7a98ec2b175493f6fa830f03a8e0321d9cc58cf2/doctest.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3521,
812,
13587,
30857,
4481,
16,
2826,
9987,
4672,
3536,
37,
2836,
3813,
11371,
364,
1245,
578,
1898,
31263,
395,
1390,
18,
225,
1021,
589,
358,
1517,
31263,
395,
585,
353,
864,
487,
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,
3521,
812,
13587,
30857,
4481,
16,
2826,
9987,
4672,
3536,
37,
2836,
3813,
11371,
364,
1245,
578,
1898,
31263,
395,
1390,
18,
225,
1021,
589,
358,
1517,
31263,
395,
585,
353,
864,
487,
2... |
return self.bus.add_signal_receiver(lambda *args: self.device_condition(udi, *args), "Condition", "org.freedesktop.Hal.Device", "org.freedesktop.Hal", udi) | def add_device_signal_recv (self, udi): | 09018ff3aec656e46e1dc005faa26cb96fd91f01 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2597/09018ff3aec656e46e1dc005faa26cb96fd91f01/DeviceManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
5964,
67,
10420,
67,
18334,
261,
2890,
16,
582,
3211,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
5964,
67,
10420,
67,
18334,
261,
2890,
16,
582,
3211,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
self.__current_realm = None | def __init__(self, passwd=None): if passwd is None: passwd = HTTPPasswordMgr() self.passwd = passwd self.add_password = self.passwd.add_password self.__current_realm = None | 479d224bbcd6d456b2b35514bc272be9a92e5143 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/479d224bbcd6d456b2b35514bc272be9a92e5143/urllib2.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
19093,
33,
7036,
4672,
309,
19093,
353,
599,
30,
19093,
273,
2239,
3913,
9455,
1435,
365,
18,
24002,
273,
19093,
365,
18,
1289,
67,
3664,
273,
365,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
19093,
33,
7036,
4672,
309,
19093,
353,
599,
30,
19093,
273,
2239,
3913,
9455,
1435,
365,
18,
24002,
273,
19093,
365,
18,
1289,
67,
3664,
273,
365,
18,
2... | |
@return True if the input was fully consumed, False otherwise. | @return: True if the input was fully consumed, False otherwise. | def full(self): """ Check whether the input was fully consumed. | 825c75951a4beaa739e372a43226ad90c2dd4643 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/847/825c75951a4beaa739e372a43226ad90c2dd4643/yeanpypa.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1983,
12,
2890,
4672,
3536,
2073,
2856,
326,
810,
1703,
7418,
12393,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1983,
12,
2890,
4672,
3536,
2073,
2856,
326,
810,
1703,
7418,
12393,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
print "global-include", pattern files = select_pattern (all_files, pattern, anchor=0) if not files: template.warn (("no files found matching '%s' " + "anywhere in distribution") % pattern) else: self.files.extend (files) | print "global-include", string.join(pattern_list) for pattern in pattern_list: files = select_pattern (all_files, pattern, anchor=0) if not files: template.warn (("no files found matching '%s' " + "anywhere in distribution") % pattern) else: self.files.extend (files) | def read_template (self): """Read and parse the manifest template file named by 'self.template' (usually "MANIFEST.in"). Process all file specifications (include and exclude) in the manifest template and add the resulting filenames to 'self.files'.""" | d1aa01cb91ac9abec6e7ba7ff3f8be6778f9dbda /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/d1aa01cb91ac9abec6e7ba7ff3f8be6778f9dbda/sdist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
3202,
261,
2890,
4672,
3536,
1994,
471,
1109,
326,
5643,
1542,
585,
4141,
635,
296,
2890,
18,
3202,
11,
261,
407,
3452,
315,
9560,
30050,
18,
267,
20387,
225,
4389,
777,
585,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
855,
67,
3202,
261,
2890,
4672,
3536,
1994,
471,
1109,
326,
5643,
1542,
585,
4141,
635,
296,
2890,
18,
3202,
11,
261,
407,
3452,
315,
9560,
30050,
18,
267,
20387,
225,
4389,
777,
585,
... |
exts.append( Extension('_CG', ['cg/_CGmodule.c'], extra_link_args=['-framework', 'ApplicationServices', '-framework', 'Carbon']) ) exts.append( Extension('_Cm', ['cm/_Cmmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Ctl', ['ctl/_Ctlmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Dlg', ['dlg/_Dlgmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Drag', ['drag/_Dragmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Evt', ['evt/_Evtmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_File', ['file/_Filemodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Folder', ['folder/_Foldermodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Fm', ['fm/_Fmmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Help', ['help/_Helpmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Icn', ['icn/_Icnmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_IBCarbon', ['ibcarbon/_IBCarbon.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_List', ['list/_Listmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Menu', ['menu/_Menumodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Mlte', ['mlte/_Mltemodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Qd', ['qd/_Qdmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Qdoffs', ['qdoffs/_Qdoffsmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Qt', ['qt/_Qtmodule.c'], extra_link_args=['-framework', 'QuickTime', '-framework', 'Carbon']) ) exts.append( Extension('_Scrap', ['scrap/_Scrapmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_TE', ['te/_TEmodule.c'], extra_link_args=['-framework', 'Carbon']) ) waste_incs = find_file("WASTE.h", [], ['../'*n + 'waste/C_C++ Headers' for n in (0,1,2,3,4)]) waste_libs = find_library_file(self.compiler, "WASTE", [], [ "../"*n + "waste/Static Libraries" for n in (0,1,2,3,4)]) if waste_incs != None and waste_libs != None: (srcdir,) = sysconfig.get_config_vars('srcdir') exts.append( Extension('waste', ['waste/wastemodule.c'] + [ os.path.join(srcdir, d) for d in 'Mac/Wastemods/WEObjectHandlers.c', 'Mac/Wastemods/WETabHooks.c', 'Mac/Wastemods/WETabs.c' ], include_dirs = waste_incs + [os.path.join(srcdir, 'Mac/Wastemods')], library_dirs = waste_libs, libraries = ['WASTE'], extra_link_args = ['-framework', 'Carbon'], ) ) exts.append( Extension('_Win', ['win/_Winmodule.c'], extra_link_args=['-framework', 'Carbon']) ) | exts.append( Extension('Nav', ['Nav.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_AE', ['ae/_AEmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_AH', ['ah/_AHmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Alias', ['alias/_Aliasmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_App', ['app/_Appmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_CarbonEvt', ['carbonevt/_CarbonEvtmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_CG', ['cg/_CGmodule.c'], extra_link_args=['-framework', 'ApplicationServices', '-framework', 'Carbon']) ) exts.append( Extension('_Cm', ['cm/_Cmmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Ctl', ['ctl/_Ctlmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Dlg', ['dlg/_Dlgmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Drag', ['drag/_Dragmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Evt', ['evt/_Evtmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_File', ['file/_Filemodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Folder', ['folder/_Foldermodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Fm', ['fm/_Fmmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Help', ['help/_Helpmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Icn', ['icn/_Icnmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_IBCarbon', ['ibcarbon/_IBCarbon.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_List', ['list/_Listmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Menu', ['menu/_Menumodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Mlte', ['mlte/_Mltemodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Qd', ['qd/_Qdmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Qdoffs', ['qdoffs/_Qdoffsmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_Qt', ['qt/_Qtmodule.c'], extra_link_args=['-framework', 'QuickTime', '-framework', 'Carbon']) ) exts.append( Extension('_Scrap', ['scrap/_Scrapmodule.c'], extra_link_args=['-framework', 'Carbon']) ) exts.append( Extension('_TE', ['te/_TEmodule.c'], extra_link_args=['-framework', 'Carbon']) ) waste_incs = find_file("WASTE.h", [], ['../'*n + 'waste/C_C++ Headers' for n in (0,1,2,3,4)]) waste_libs = find_library_file(self.compiler, "WASTE", [], ["../"*n + "waste/Static Libraries" for n in (0,1,2,3,4)]) if waste_incs != None and waste_libs != None: (srcdir,) = sysconfig.get_config_vars('srcdir') exts.append( Extension('waste', ['waste/wastemodule.c'] + [ os.path.join(srcdir, d) for d in 'Mac/Wastemods/WEObjectHandlers.c', 'Mac/Wastemods/WETabHooks.c', 'Mac/Wastemods/WETabs.c' ], include_dirs = waste_incs + [os.path.join(srcdir, 'Mac/Wastemods')], library_dirs = waste_libs, libraries = ['WASTE'], extra_link_args = ['-framework', 'Carbon'], ) ) exts.append( Extension('_Win', ['win/_Winmodule.c'], extra_link_args=['-framework', 'Carbon']) ) | def detect_modules(self): # Ensure that /usr/local is always used add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') | 05ced6aa761bab7348e95a479b6f791e636ceae7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/05ced6aa761bab7348e95a479b6f791e636ceae7/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5966,
67,
6400,
12,
2890,
4672,
468,
7693,
716,
342,
13640,
19,
3729,
353,
3712,
1399,
527,
67,
1214,
67,
869,
67,
1098,
12,
2890,
18,
9576,
18,
12083,
67,
8291,
16,
1173,
13640,
19,
... |
self.vboxlayout10.addWidget(self.minimize_engine_combobox) self.vboxlayout4.addWidget(self.buttonGroup8_2) self.vboxlayout2.addLayout(self.vboxlayout4) self.vboxlayout1.addLayout(self.vboxlayout2) | self.vboxlayout8.addWidget(self.minimize_engine_combobox) self.vboxlayout1.addWidget(self.buttonGroup8_2) | def setupUi(self, MinimizeEnergyPropDialog): MinimizeEnergyPropDialog.setObjectName("MinimizeEnergyPropDialog") MinimizeEnergyPropDialog.resize(QtCore.QSize(QtCore.QRect(0,0,400,842).size()).expandedTo(MinimizeEnergyPropDialog.minimumSizeHint())) | 4cf7d69a606c10cf896a0045c5df06ba517408f0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/4cf7d69a606c10cf896a0045c5df06ba517408f0/MinimizeEnergyPropDialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
5444,
10153,
664,
31920,
4658,
6353,
4672,
5444,
10153,
664,
31920,
4658,
6353,
18,
542,
16707,
2932,
2930,
10153,
664,
31920,
4658,
6353,
7923,
5444,
10153,
664,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3875,
13943,
12,
2890,
16,
5444,
10153,
664,
31920,
4658,
6353,
4672,
5444,
10153,
664,
31920,
4658,
6353,
18,
542,
16707,
2932,
2930,
10153,
664,
31920,
4658,
6353,
7923,
5444,
10153,
664,
... |
2 3 4 5 [0,x,2x ,3x ,4x ,5x ] | [0,x,2*x*x,3*x**3,4*x**4,5*x**5] | def __getitem__(self, n): r""" Return the n-th element of this list. | 50acc81698e4afd3de40f0f0c32cdf71652bdaf4 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/50acc81698e4afd3de40f0f0c32cdf71652bdaf4/axiom.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
290,
4672,
436,
8395,
2000,
326,
290,
17,
451,
930,
434,
333,
666,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
31571,
972,
12,
2890,
16,
290,
4672,
436,
8395,
2000,
326,
290,
17,
451,
930,
434,
333,
666,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
def execute(self, testdir = None, iterations = 1, filesize='100M', type='write', pattern='random'): | def run_once(self, testdir = None, filesize='100M', type='write', pattern='random'): | def execute(self, testdir = None, iterations = 1, filesize='100M', type='write', pattern='random'): cmd = os.path.join(self.srcdir, 'src/spew') if not testdir: testdir = self.tmpdir tmpfile = os.path.join(testdir, 'spew-test.%d' % os.getpid()) results = os.path.join(self.resultsdir, 'stdout') args = '--%s -i %d -p %s -b 2k -B 2M %s %s' % \ (type, iterations, pattern, filesize, tmpfile) cmd += ' ' + args | f6978e3defa9f694551fee7e8c33682787098e97 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10349/f6978e3defa9f694551fee7e8c33682787098e97/spew.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
12,
2890,
16,
1842,
1214,
273,
599,
16,
14104,
2218,
6625,
49,
2187,
618,
2218,
2626,
2187,
1936,
2218,
9188,
11,
4672,
1797,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
67,
8243,
12,
2890,
16,
1842,
1214,
273,
599,
16,
14104,
2218,
6625,
49,
2187,
618,
2218,
2626,
2187,
1936,
2218,
9188,
11,
4672,
1797,
273,
1140,
18,
803,
18,
5701,
12,
2890,
18... |
value = context.get_form_value(name) | def build_namespace(self, resource, context): """This utility method builds a namespace suitable to use to produce an HTML form. Its input data is a dictionnary that defines the form variables to consider: | 52c1c0c8ce10391f5181ea1dafe2304c29f5859a /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12681/52c1c0c8ce10391f5181ea1dafe2304c29f5859a/views.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
4937,
12,
2890,
16,
1058,
16,
819,
4672,
3536,
2503,
12788,
707,
10736,
279,
1981,
10631,
358,
999,
358,
11402,
392,
3982,
646,
18,
29517,
810,
501,
353,
279,
302,
2228,
82,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
4937,
12,
2890,
16,
1058,
16,
819,
4672,
3536,
2503,
12788,
707,
10736,
279,
1981,
10631,
358,
999,
358,
11402,
392,
3982,
646,
18,
29517,
810,
501,
353,
279,
302,
2228,
82,
... | |
meta = '\n <meta name="aesop" content="%s">' | meta = '<meta name="aesop" content="%s">\n ' % self.aesop_type | def get_header(self): s = HEAD % self.variables if self.uplink: if self.uptitle: link = ('<link rel="up" href="%s" title="%s">' % (self.uplink, self.uptitle)) else: link = '<link rel="up" href="%s">' % self.uplink repl = " %s\n</head>" % link s = s.replace("</head>", repl, 1) if self.aesop_type: meta = '\n <meta name="aesop" content="%s">' # Insert this in the middle of the head that's been # generated so far, keeping <meta> and <link> elements in # neat groups: s = s.replace("<link ", meta + "<link ", 1) return s | b82b1017d05acfd3881a0fd1a45bb06cd26b6df8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/b82b1017d05acfd3881a0fd1a45bb06cd26b6df8/support.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
3374,
12,
2890,
4672,
272,
273,
14792,
738,
365,
18,
7528,
309,
365,
18,
89,
20157,
30,
309,
365,
18,
3648,
1280,
30,
1692,
273,
7707,
32,
1232,
1279,
1546,
416,
6,
3897,
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,
336,
67,
3374,
12,
2890,
4672,
272,
273,
14792,
738,
365,
18,
7528,
309,
365,
18,
89,
20157,
30,
309,
365,
18,
3648,
1280,
30,
1692,
273,
7707,
32,
1232,
1279,
1546,
416,
6,
3897,
11... |
except AttributeError: | except Exception: | def worksheet_that_was_published(self): """ Return owner and id_number of the worksheet that was published to get this worksheet, if this worksheet was published. Otherwise just return this worksheet. OUTPUT: Worksheet EXAMPLES:: sage: nb = sagenb.notebook.notebook.Notebook(tmp_dir()) sage: W = nb.create_new_worksheet('Publish Test', 'admin') sage: W.worksheet_that_was_published() is W True :: sage: S = nb.publish_worksheet(W, 'admin') sage: S.worksheet_that_was_published() is S False sage: S.worksheet_that_was_published() is W True """ try: return self.notebook().get_worksheet_with_filename('%s/%s'%self.__worksheet_came_from) except AttributeError: return self | 870b9be89c103de033db13834191333a4f99564a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11792/870b9be89c103de033db13834191333a4f99564a/worksheet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
13622,
67,
19056,
67,
17416,
67,
12614,
12,
2890,
4672,
3536,
2000,
3410,
471,
612,
67,
2696,
434,
326,
13622,
716,
1703,
9487,
358,
336,
333,
13622,
16,
309,
333,
13622,
1703,
9487,
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,
13622,
67,
19056,
67,
17416,
67,
12614,
12,
2890,
4672,
3536,
2000,
3410,
471,
612,
67,
2696,
434,
326,
13622,
716,
1703,
9487,
358,
336,
333,
13622,
16,
309,
333,
13622,
1703,
9487,
18,... |
def __init__(data = None) | def __init__(data = None): | def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 482) else quickfix.StringField.__init__(self, 482, 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,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
9934,
22,
13,
469,
9549,
904,
18,
780,
974,
16186,
2738,
97... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
892,
273,
599,
4672,
309,
501,
422,
599,
30,
9549,
904,
18,
780,
974,
16186,
2738,
972,
12,
2890,
16,
9934,
22,
13,
469,
9549,
904,
18,
780,
974,
16186,
2738,
97... |
filename = '%s-%s_%s_%05.2fkm_%05.1fs.pdf' % (filename_prefix, grid_name, start_time.strftime('%Y%m%d_%H%M%S'), dx, time_delta.seconds) | filename = '%s-%s_%s_%05.2fkm_%05.1fs.%s' % (filename_prefix, grid_name, start_time.strftime('%Y%m%d_%H%M%S'), dx, time_delta.seconds, image_type) | def make_plot(filename, grid_name, x_name='x', y_name='y', t_name='time', n_cols=6, outpath='', filename_prefix='LMA'): f = nc.NetCDFFile(filename) data = f.variables # dictionary of variable names to nc_var objects dims = f.dimensions # dictionary of dimension names to sizes x = data[y_name] y = data[x_name] t = data[t_name] grid = data[grid_name] assert len(x.shape) == 1 assert len(y.shape) == 1 assert len(t.shape) == 1 grid_dims = grid.dimensions # tuple of dimension names name_to_idx = dict((k, i) for i, k in enumerate(grid_dims)) grid_t_idx = name_to_idx[t.dimensions[0]] grid_x_idx = name_to_idx[x.dimensions[0]] grid_y_idx = name_to_idx[y.dimensions[0]] n_frames = t.shape[0] # n_cols = 6 n_rows = int(ceil( float(n_frames) / n_cols )) w, h = figaspect(float(n_rows)/n_cols) colormap = get_cmap('gist_earth') grey_color = (0.5,)*3 frame_color = (0.2,)*3 density_maxes = [] total_counts = [] all_t = [] xedge = centers_to_edges(x) x_range = xedge.max() - xedge.min() yedge = centers_to_edges(y) y_range = yedge.max() - yedge.min() dx = (xedge[1]-xedge[0]) # count_scale_factor = dx # / 1000.0 # max_count_baseline = 450 * count_scale_factor #/ 10.0 min_count, max_count = 1, grid[:].max() #max_count_baseline*(t[1]-t[0]) f.close() fig = Figure(figsize=(w,h)) canvas = FigureCanvasAgg(fig) fig.set_canvas(canvas) p = small_multiples_plot(fig=fig, rows=n_rows, columns=n_cols) p.label_edges(True) pad = 0.0 # for time labels in each frame for ax in p.multiples.flat: ax.set_axis_bgcolor('black') ax.spines['top'].set_edgecolor(frame_color) ax.spines['bottom'].set_edgecolor(frame_color) ax.spines['left'].set_edgecolor(frame_color) ax.spines['right'].set_edgecolor(frame_color) # ax.yaxis.set_major_formatter(kilo_formatter) # ax.xaxis.set_major_formatter(kilo_formatter) base_date = datetime.strptime(t.units, "seconds since %Y-%m-%d %H:%M:%S") time_delta = timedelta(0,float(t[1]-t[0]),0) start_time = base_date + time_delta indexer = [None,]*len(grid.shape) for i in range(n_frames): frame_start = base_date + timedelta(0,float(t[i]),0) indexer[grid_t_idx] = i density = grid[indexer] # density,edges = np.histogramdd((x,y), bins=(xedge,yedge)) density_plot = p.multiples.flat[i].pcolormesh(xedge,yedge, np.log10(density.transpose()), vmin=-0.2, vmax=np.log10(max_count), cmap=colormap) label_string = frame_start.strftime('%H%M:%S') text_label = p.multiples.flat[i].text(xedge[0]-pad+x_range*.015, yedge[0]-pad+y_range*.015, label_string, color=grey_color, size=6) # density_plot.set_rasterized(True) density_maxes.append(density.max()) total_counts.append(density.sum()) all_t.append(frame_start) print label_string, x.shape, density.max(), density.sum() color_scale = ColorbarBase(p.colorbar_ax, cmap=density_plot.cmap, norm=density_plot.norm, orientation='horizontal') # color_scale.set_label('count per pixel') color_scale.set_label('log10(count per pixel)') view_x = (xedge.min(), xedge.max()) view_y = (yedge.min(), yedge.max()) print 'making multiples', p.multiples.flat[0].axis(view_x+view_y) filename = '%s-%s_%s_%05.2fkm_%05.1fs.pdf' % (filename_prefix, grid_name, start_time.strftime('%Y%m%d_%H%M%S'), dx, time_delta.seconds) filename = os.path.join(outpath, filename) fig.savefig(filename, dpi=150) print ' ... done' | 0039dd35d2c619e6d3412278f7c12383bcf06c59 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7619/0039dd35d2c619e6d3412278f7c12383bcf06c59/multiples_nc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4032,
12,
3459,
16,
3068,
67,
529,
16,
619,
67,
529,
2218,
92,
2187,
677,
67,
529,
2218,
93,
2187,
268,
67,
529,
2218,
957,
2187,
290,
67,
6842,
33,
26,
16,
596,
803,
221... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
4032,
12,
3459,
16,
3068,
67,
529,
16,
619,
67,
529,
2218,
92,
2187,
677,
67,
529,
2218,
93,
2187,
268,
67,
529,
2218,
957,
2187,
290,
67,
6842,
33,
26,
16,
596,
803,
221... |
'basic':basic, 'advantages_gross':allowance, 'gross':basic + allowance, | 'basic':basic, 'advantages_gross':allowance, 'gross':basic + allowance, | def _calculate_salary(self, cr, uid, ids, field_names, arg, context=None): vals = {} slip_line_pool = self.pool.get('hr.payslip.line') for employee in self.browse(cr, uid, ids, context): if not employee.contract_id: vals[employee.id] = {'basic':0.0, 'gross':0.0, 'net':0.0, 'advantages_gross':0.0, 'advantages_net':0.0} continue basic = employee.contract_id.basic gross = employee.contract_id.gross net = employee.contract_id.net allowance = employee.contract_id.advantages_gross deduction = employee.contract_id.advantages_net obj = { 'basic':basic, 'gross':gross, 'net':net } for line in employee.line_ids: base = line.category_id.base try: amt = eval(base, obj) except Exception, e: raise osv.except_osv(_('Variable Error !'), _('Variable Error : %s ' % (e))) amount = 0.0 if line.amount_type == 'per': amount = amt * line.amount elif line.amount_type == 'func': amount = slip_line_pool.execute_function(cr, uid, line.id, amt, context) elif line.amount_type == 'fix': amount = line.amount if line.type == 'allowance': allowance += amount elif line.type == 'deduction': deduction += amount vals[employee.id] = { 'basic':basic, 'advantages_gross':allowance, 'gross':basic + allowance, 'advantages_net':deduction, 'net':basic + allowance - deduction } return vals | 90e8a2a9ac966d2bf970850306e713ecc1398f14 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/90e8a2a9ac966d2bf970850306e713ecc1398f14/hr_payroll.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11162,
67,
21982,
814,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
5773,
273,
2618,
272,
3169,
67,
1369,
67,
6011,
273,
365,
18... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
11162,
67,
21982,
814,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
652,
67,
1973,
16,
1501,
16,
819,
33,
7036,
4672,
5773,
273,
2618,
272,
3169,
67,
1369,
67,
6011,
273,
365,
18... |
if not(tool.checkPermission('Add portal content', self.scope)) : | if not(tool.checkPermission('Add portal content', self.data['scope'])) : | def __call__(self): context = aq_inner(self.context) request = aq_inner(self.request) session = request.get('SESSION', None) # use self.rootpath or rootpath in request or session to change browser root self.rootpath = request.get('rootpath', self.rootpath) # use self.browse=False (or browse=False in request) to disallow browsing globally self.browse = request.get('browse', self.browse) self.showbreadcrumbs = request.get('showbreadcrumbs', self.showbreadcrumbs) if not self.browse : self.showbreadcrumbs = False self.setScopeInfos(context, request, self.showbreadcrumbs) # use self.multiselect = False (or multiselect = False in request) # when multiselect is False window is closed on insert self.multiselect = request.get('multiselect', self.multiselect) # to force close on insert even in multiselect mode self.forcecloseoninsert = request.get('forcecloseoninsert', self.forcecloseoninsert) if not self.multiselect : self.forcecloseoninsert = 1 # use self.types (or types in request) to specify portal_types in catalog request self.types = request.get('types', self.types) # use self.typeupload (or typeupload in request) to specify portal_type for upload self.typeupload = request.get('typeupload', self.typeupload) # use self.typefolder (or typefolder in request) to specify portal_type used to create folder self.typefolder = request.get('typefolder', self.typefolder) # use self.typeview (or typeview in request) to specify typeview ('file' or 'image' for now, 'selection' in future) self.typeview = request.get('typeview', self.typeview) if self.typeview == 'image' : self.typecss = 'float' | 8d0e1a032cfde6336dbc8c8e4be99c7fcb7c9176 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9052/8d0e1a032cfde6336dbc8c8e4be99c7fcb7c9176/finder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
225,
819,
273,
279,
85,
67,
7872,
12,
2890,
18,
2472,
13,
590,
273,
279,
85,
67,
7872,
12,
2890,
18,
2293,
13,
1339,
273,
590,
18,
588,
2668,
7042,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
4672,
225,
819,
273,
279,
85,
67,
7872,
12,
2890,
18,
2472,
13,
590,
273,
279,
85,
67,
7872,
12,
2890,
18,
2293,
13,
1339,
273,
590,
18,
588,
2668,
7042,
... |
def _deliver_exception_to_MAIN(g): if not g.successful(): MAIN.throw(*g.exc_info()) | def _wrap_signal_handler(handler, args, kwargs): try: handler(*args, **kwargs) except: core.active_event(MAIN.throw, *sys.exc_info()) | def _deliver_exception_to_MAIN(g): if not g.successful(): MAIN.throw(*g.exc_info()) | df06525ea774f3ef97f62715890eeb0d1b61fd8b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10423/df06525ea774f3ef97f62715890eeb0d1b61fd8b/hub.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4113,
67,
10420,
67,
4176,
12,
4176,
16,
833,
16,
1205,
4672,
775,
30,
1838,
30857,
1968,
16,
2826,
4333,
13,
1335,
30,
2922,
18,
3535,
67,
2575,
12,
19803,
18,
12849,
16,
380,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4113,
67,
10420,
67,
4176,
12,
4176,
16,
833,
16,
1205,
4672,
775,
30,
1838,
30857,
1968,
16,
2826,
4333,
13,
1335,
30,
2922,
18,
3535,
67,
2575,
12,
19803,
18,
12849,
16,
380,
... |
Assemble = Assemble + " --64" | AssemblerFlags = AssemblerFlags + " --64" | def Boot(): global BuildLocal BuildLocal += " -boot -keep -DM3CC_TARGET=" + Config Version = "1" # This information is duplicated from the config files. # TBD: put it only in one place. # The older bootstraping method does get that right. vms = StringTagged(Config, "VMS") # pick the compiler if Config == "ALPHA32_VMS": cc = "cc" cflags = " " elif Config == "ALPHA64_VMS": cc = "cc" cflags = "/pointer_size=64 " elif StringTagged(Config, "SOLARIS") or Config == "SOLsun": cc = "/usr/bin/cc" cflags = "-g -mt -xldscope=symbolic " else: # gcc platforms cc = { "SOLgnu" : "/usr/sfw/bin/gcc", }.get(Config) or "gcc" cflags = { "I386_INTERIX" : "-g ", # gcc -fPIC generates incorrect code on Interix "SOLgnu" : "-g ", # -fPIC? }.get(Config) or "-g -fPIC " cflags = cflags + ({ "AMD64_LINUX" : " -m64 -mno-align-double ", "AMD64_DARWIN" : " -arch x86_64 ", "PPC64_DARWIN" : " -arch ppc64 ", "ARM_DARWIN" : " -march=armv6 -mcpu=arm1176jzf-s ", "LINUXLIBC6" : " -m32 -mno-align-double ", "I386_LINUX" : " -m32 -mno-align-double ", "MIPS64_OPENBSD" : " -mabi=64 ", "SOLgnu" : " -m32 -mcpu=v9 ", "I386_SOLARIS" : " -xarch=pentium_pro -Kpic ", "AMD64_SOLARIS" : " -xarch=amd64 -Kpic ", "SOLsun" : " -xarch=v8plus -xcode=pic32 ", "SPARC32_SOLARIS" : " -xarch=v8plus -xcode=pic32 ", "SPARC64_SOLARIS" : " -xarch=v9 -xcode=pic32 ", "SPARC32_LINUX" : " -m32 -mcpu=v9 -munaligned-doubles ", "SPARC64_LINUX" : " -m64 -munaligned-doubles ", }.get(Config) or " ") Link = "$(CC) $(CFLAGS) *.mo *.io *.o " # link flags if StringTagged(Target, "DARWIN"): pass elif StringTagged(Target, "SOLARIS") or Target.startswith("SOL"): Link = Link + " -lrt -lm -lnsl -lsocket -lpthread " elif StringTagged(Target, "HPUX"): Link = Link + " -lrt -lm " elif StringTagged(Target, "INTERIX"): Link = Link + " -lm " else: Link = Link + " -lm -lpthread " # add -c to compiler but not link (i.e. not cflags) Compile = "$(CC) $(CFLAGS) " if not StringTagged(Config, "VMS"): Compile = Compile + " -c " AssembleOnTarget = not vms AssembleOnHost = not AssembleOnTarget # pick assembler if StringTagged(Target, "VMS") and AssembleOnTarget: Assemble = "macro /alpha " # not right, come back to it later elif StringTagged(Target, "SOLARIS") or Target.startswith("SOL"): Assemble = "/usr/ccs/bin/as " else: Assemble = "as " # set assembler flags if Target != "PPC32_OPENBSD" and Target != "PPC_LINUX": # "Tag" not right for LINUX due to LINUXLIBC6 # "Tag" not right for BSD or 64 either. if Target.find("LINUX") != -1 or Target.find("BSD") != -1: if Target.find("64") != -1 or (StringTagged(Target, "ALPHA") and not StringTagged(Target, "ALPHA32")): Assemble = Assemble + " --64" else: Assemble = Assemble + " --32" Assemble = (Assemble + ({ "AMD64_DARWIN" : " -arch x86_64 ", "PPC64_DARWIN" : " -arch ppc64 ", "ARM_DARWIN" : " -arch armv6 ", # -s puts symbols where linker won't automatically strip them "I386_SOLARIS" : " -s ", "AMD64_SOLARIS" : " -s -xarch=amd64 ", "SOLgnu" : " -s -xarch=v8plus ", "SOLsun" : " -s -xarch=v8plus ", "SPARC32_SOLARIS" : " -s -xarch=v8plus ", "SPARC64_SOLARIS" : " -s -xarch=v9 ", }.get(Target) or "")) GnuPlatformPrefix = { "ARM_DARWIN" : "arm-apple-darwin8-", "ALPHA32_VMS" : "alpha-dec-vms-", "ALPHA64_VMS" : "alpha64-dec-vms-", }.get(Target) or "" if not vms: cc = GnuPlatformPrefix + cc Link = GnuPlatformPrefix + Link if (not vms) or AssembleOnHost: Assemble = GnuPlatformPrefix + Assemble # # squeeze runs of spaces and spaces at ends # cflags = re.sub(" +", " ", cflags) cflags = re.sub(" +$", "", cflags) cflags = re.sub("^ +", "", cflags) Compile = re.sub(" +", " ", Compile) Compile = re.sub(" +$", "", Compile) Compile = re.sub("^ +", "", Compile) Link = re.sub(" +", " ", Link) Link = re.sub(" +$", "", Link) Assemble = re.sub(" +", " ", Assemble) Assemble = re.sub(" +$", "", Assemble) BootDir = "./cm3-boot-" + Target + "-" + Version P = [ "m3cc", "import-libs", "m3core", "libm3", "sysutils", "m3middle", "m3quake", "m3objfile", "m3linker", "m3back", "m3front", "cm3" ] #DoPackage(["", "realclean"] + P) or sys.exit(1) DoPackage(["", "buildlocal"] + P) or sys.exit(1) try: shutil.rmtree(BootDir) except: pass try: os.mkdir(BootDir) except: pass # # This would probably be a good use of XSL (xml style sheets) # Make = open(os.path.join(BootDir, "make.sh"), "wb") VmsMake = open(os.path.join(BootDir, "vmsmake.com"), "wb") VmsLink = open(os.path.join(BootDir, "vmslink.opt"), "wb") Makefile = open(os.path.join(BootDir, "Makefile"), "wb") UpdateSource = open(os.path.join(BootDir, "updatesource.sh"), "wb") Objects = { } Makefile.write(".SUFFIXES:\n" + ".SUFFIXES: .c .is .ms .s .o .obj .io .mo\n\n" + "all: cm3\n\n" + "clean:\n" + "\trm -rf *.io *.mo *.o *.obj\n\n") for a in [UpdateSource, Make]: a.write("#!/bin/sh\n\n" + "set -e\n" + "set -x\n\n") for a in [Makefile]: a.write("# edit up here\n\n" + "CC ?= " + cc + "\n" + "CFLAGS ?= " + cflags + "\n" + "Compile=" + Compile + "\n" + "Assemble=" + Assemble + "\n" + "Link=" + Link + "\n" + "\n# no more editing should be needed\n\n") for a in [Make]: a.write("# edit up here\n\n" + "CC=${CC:-" + cc + "}\n" + "CFLAGS=${CFLAGS:-" + cflags + "}\n" + "Compile=" + Compile + "\n" + "Assemble=" + Assemble + "\n" + "Link=" + Link + "\n" + "\n# no more editing should be needed\n\n") for q in P: dir = GetPackagePath(q) for a in os.listdir(os.path.join(Root, dir, Config)): ext_c = a.endswith(".c") ext_h = a.endswith(".h") ext_s = a.endswith(".s") ext_ms = a.endswith(".ms") ext_is = a.endswith(".is") if not (ext_c or ext_h or ext_s or ext_ms or ext_is): continue fullpath = os.path.join(Root, dir, Config, a) if ext_h or ext_c or not vms or AssembleOnTarget: CopyFile(fullpath, BootDir) if ext_h: continue Object = GetObjectName(a) if Objects.get(Object): continue Objects[Object] = 1 if ext_c: VmsMake.write("$ " + Compile + " " + a + "\n") else: if AssembleOnHost: # must have cross assembler a = Assemble + " " + fullpath + " -o " + BootDir + "/" + Object print(a) os.system(a) else: VmsMake.write("$ " + Assemble + " " + a + "\n") VmsLink.write(Object + "/SELECTIVE_SEARCH\n") Makefile.write(".c.o:\n" + "\t$(Compile) -o $@ $<\n\n" + ".c.obj:\n" + "\t$(Compile) -o $@ $<\n\n" + ".is.io:\n" + "\t$(Assemble) -o $@ $<\n\n" + ".s.o:\n" + "\t$(Assemble) -o $@ $<\n\n" + ".ms.mo:\n" + "\t$(Assemble) -o $@ $<\n\n") Makefile.write("cm3:") Objects = Objects.keys() Objects.sort() k = 4 for a in Objects: k = k + 1 + len(a) if k > 76: # line wrap Makefile.write(" \\\n") k = 1 + len(a) Makefile.write(" " + a) Makefile.write("\n\t") VmsMake.write("$ set file/attr=(rfm=var,rat=none) *.o\n") VmsMake.write("$ set file/attr=(rfm=var,rat=none) *.obj\n") VmsMake.write("$ set file/attr=(rfm=var,rat=none) *.mo\n") VmsMake.write("$ set file/attr=(rfm=var,rat=none) *.io\n") VmsMake.write("$ link /executable=cm3.exe vmslink/options\n") for a in [Make, Makefile]: a.write("$(Link) -o cm3\n") for a in [ # # Add to this list as needed. # Adding more than necessary is ok -- assume the target system has no changes, # so we can replace whatever is there. # "m3-libs/libm3/src/os/POSIX/OSConfigPosix.m3", "m3-libs/libm3/src/random/m3makefile", "m3-libs/m3core/src/m3makefile", "m3-libs/m3core/src/Uwaitpid.quake", "m3-libs/m3core/src/thread.quake", "m3-libs/m3core/src/C/m3makefile", "m3-libs/m3core/src/C/" + Target + "/m3makefile", "m3-libs/m3core/src/C/Common/m3makefile", "m3-libs/m3core/src/Csupport/m3makefile", "m3-libs/m3core/src/float/m3makefile", "m3-libs/m3core/src/runtime/m3makefile", "m3-libs/m3core/src/runtime/common/m3makefile", "m3-libs/m3core/src/runtime/common/Compiler.tmpl", "m3-libs/m3core/src/runtime/common/m3text.h", "m3-libs/m3core/src/runtime/common/RTError.h", "m3-libs/m3core/src/runtime/common/RTMachine.i3", "m3-libs/m3core/src/runtime/common/RTProcess.h", "m3-libs/m3core/src/runtime/common/RTSignalC.c", "m3-libs/m3core/src/runtime/common/RTSignalC.h", "m3-libs/m3core/src/runtime/common/RTSignalC.i3", "m3-libs/m3core/src/runtime/common/RTSignal.i3", "m3-libs/m3core/src/runtime/common/RTSignal.m3", "m3-libs/m3core/src/runtime/" + Target + "/m3makefile", "m3-libs/m3core/src/runtime/" + Target + "/RTMachine.m3", "m3-libs/m3core/src/runtime/" + Target + "/RTSignal.m3", "m3-libs/m3core/src/runtime/" + Target + "/RTThread.m3", "m3-libs/m3core/src/text/TextLiteral.i3", "m3-libs/m3core/src/thread/m3makefile", "m3-libs/m3core/src/thread/PTHREAD/m3makefile", "m3-libs/m3core/src/thread/PTHREAD/ThreadPThread.m3", "m3-libs/m3core/src/thread/PTHREAD/ThreadPThreadC.i3", "m3-libs/m3core/src/thread/PTHREAD/ThreadPThreadC.c", "m3-libs/m3core/src/time/POSIX/m3makefile", "m3-libs/m3core/src/unix/m3makefile", "m3-libs/m3core/src/unix/Common/m3makefile", "m3-libs/m3core/src/unix/Common/m3unix.h", "m3-libs/m3core/src/unix/Common/Udir.i3", "m3-libs/m3core/src/unix/Common/UdirC.c", "m3-libs/m3core/src/unix/Common/Usignal.i3", "m3-libs/m3core/src/unix/Common/Ustat.i3", "m3-libs/m3core/src/unix/Common/UstatC.c", "m3-libs/m3core/src/unix/Common/UtimeC.c", "m3-libs/m3core/src/unix/Common/Uucontext.i3", "m3-sys/cminstall/src/config-no-install/SOLgnu", "m3-sys/cminstall/src/config-no-install/SOLsun", "m3-sys/cminstall/src/config-no-install/Solaris.common", "m3-sys/cminstall/src/config-no-install/Unix.common", "m3-sys/cminstall/src/config-no-install/cm3cfg.common", "m3-sys/cminstall/src/config-no-install/" + Target, "m3-sys/m3cc/src/m3makefile", "m3-sys/m3cc/src/gcc/m3cg/parse.c", "m3-sys/m3middle/src/Target.i3", "m3-sys/m3middle/src/Target.m3", "scripts/python/pylib.py", "m3-libs/m3core/src/C/" + Target + "/Csetjmp.i3", "m3-libs/m3core/src/C/" + Target + "/m3makefile", "m3-libs/m3core/src/C/Common/Csetjmp.i3", "m3-libs/m3core/src/C/Common/Csignal.i3", "m3-libs/m3core/src/C/Common/Cstdio.i3", "m3-libs/m3core/src/C/Common/Cstring.i3", "m3-libs/m3core/src/C/Common/m3makefile", ]: source = os.path.join(Root, a) if FileExists(source): name = GetLastPathElement(a) reldir = RemoveLastPathElement(a) destdir = os.path.join(BootDir, reldir) dest = os.path.join(destdir, name) try: os.makedirs(destdir) except: pass CopyFile(source, dest) for b in [UpdateSource, Make]: b.write("mkdir -p /dev2/cm3/" + reldir + "\n") b.write("cp " + a + " /dev2/cm3/" + a + "\n") for a in [UpdateSource, Make, Makefile, VmsMake, VmsLink]: a.close() # write entirely new custom makefile for NT # We always have object files so just compile and link in one fell swoop. if StringTagged(Config, "NT") or Config == "NT386": DeleteFile("updatesource.sh") DeleteFile("make.sh") Makefile = open(os.path.join(BootDir, "Makefile"), "wb") Makefile.write("cm3.exe: *.io *.mo *.c\r\n" + " cl -Zi -MD *.c -link *.mo *.io -out:cm3.exe user32.lib kernel32.lib wsock32.lib comctl32.lib gdi32.lib advapi32.lib netapi32.lib\r\n") Makefile.close() if vms or StringTagged(Config, "NT") or Config == "NT386": _MakeZip(BootDir[2:]) else: _MakeTGZ(BootDir[2:]) | 14e6facff06b2fc91279af79db1d8f8435565022 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9328/14e6facff06b2fc91279af79db1d8f8435565022/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26254,
13332,
225,
2552,
3998,
2042,
3998,
2042,
1011,
315,
300,
7137,
300,
10102,
300,
16125,
23,
6743,
67,
16374,
1546,
397,
1903,
225,
4049,
273,
315,
21,
6,
225,
468,
1220,
1779,
353... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26254,
13332,
225,
2552,
3998,
2042,
3998,
2042,
1011,
315,
300,
7137,
300,
10102,
300,
16125,
23,
6743,
67,
16374,
1546,
397,
1903,
225,
4049,
273,
315,
21,
6,
225,
468,
1220,
1779,
353... |
print "sqlStr = %s" % sqlStr | def update(self, table_name, rows, columns = [], keys = {}, encode = [], encodeb64 = []): """ update method to update the table rows based on the primary keys provided | b376c96e3507d4b825ad80d1af2f010bb8d1f2df /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/b376c96e3507d4b825ad80d1af2f010bb8d1f2df/Operation.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
1014,
67,
529,
16,
2595,
16,
2168,
273,
5378,
16,
1311,
273,
10615,
2017,
273,
5378,
16,
2017,
70,
1105,
273,
5378,
4672,
3536,
1089,
707,
358,
1089,
326,
1014,
259... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
12,
2890,
16,
1014,
67,
529,
16,
2595,
16,
2168,
273,
5378,
16,
1311,
273,
10615,
2017,
273,
5378,
16,
2017,
70,
1105,
273,
5378,
4672,
3536,
1089,
707,
358,
1089,
326,
1014,
259... | |
self.__sessions[callId] = newSession | self.__callids[callId] = newCall | def sip_INVITE(self, requestLine, headers, body): global g_sipconfig | d995da2606eccd46f73ea5846930ead736911f1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8801/d995da2606eccd46f73ea5846930ead736911f1a/sip.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10341,
67,
706,
58,
5398,
12,
2890,
16,
590,
1670,
16,
1607,
16,
1417,
4672,
2552,
314,
67,
28477,
1425,
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,
10341,
67,
706,
58,
5398,
12,
2890,
16,
590,
1670,
16,
1607,
16,
1417,
4672,
2552,
314,
67,
28477,
1425,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
g._arrow(xmin, ymin, xmax, ymax, options=options) | g._arrow(xtail, ytail, xhead, yhead, options=options) | def __call__(self, minpoint, maxpoint, **kwds): options = dict(self.options) for k, v in kwds.iteritems(): options[k] = v xmin = float(minpoint[0]) ymin = float(minpoint[1]) xmax = float(maxpoint[0]) ymax = float(maxpoint[1]) | 6942445bd66f38e595fafb79a120a8709a142bb9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/6942445bd66f38e595fafb79a120a8709a142bb9/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1131,
1153,
16,
943,
1153,
16,
2826,
25577,
4672,
702,
273,
2065,
12,
2890,
18,
2116,
13,
364,
417,
16,
331,
316,
17149,
18,
2165,
3319,
13332,
702,
63,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
1131,
1153,
16,
943,
1153,
16,
2826,
25577,
4672,
702,
273,
2065,
12,
2890,
18,
2116,
13,
364,
417,
16,
331,
316,
17149,
18,
2165,
3319,
13332,
702,
63,
... |
trailer = [" else:"] trailer += [" raise TypeError('function takes exactly 5 arguments (%d given)'%argc)"] | if maxargs == minargs: trailer = [" else:"] err_msg = "" trailer += [" raise TypeError('function takes exactly "+str(argcounts[0])+" arguments (%d given)'%argc)"] | yield "def __init__(self, *args):" | 6779bad902742cb87d4bfc4d7f420f2edcb50621 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/6779bad902742cb87d4bfc4d7f420f2edcb50621/_enum_exceptions.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
2824,
315,
536,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
13,
2773,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
2824,
315,
536,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
13,
2773,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if(type(child) == phat.HFanSlider) or (type(child) == phat.SliderButton): | if(type(child) == phat.HFanSlider) or (type(child) == phat.SliderButton) or (type(child) == phat.Knob): | def save_rec(self, doc, parent_node, child): | ad183cde913994aad3e46a7fded713034d9fb64e /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2237/ad183cde913994aad3e46a7fded713034d9fb64e/khagan.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
3927,
12,
2890,
16,
997,
16,
982,
67,
2159,
16,
1151,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
67,
3927,
12,
2890,
16,
997,
16,
982,
67,
2159,
16,
1151,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
url = '%sshow/%s/' % (SERVICE_URL, pid) | url = '%sshow/%s/' % (_server_name, pid) | def main(): """Main script entry point.""" usage = ('Usage: %%prog [options] [FILE ...]\n\n' 'Read the files and paste their contents to %s.\n' 'If no file is given, read from standard input.\n' 'If multiple files are given, they are put into a single paste.' % SERVICE_URL) parser = OptionParser(usage=usage) settings = load_default_settings() parser.add_option('-v', '--version', action='store_true', help='Print script version') parser.add_option('-L', '--languages', action='store_true', default=False, help='Retrieve a list of supported languages') parser.add_option('-l', '--language', default=settings['language'], help='Used syntax highlighter for the file') parser.add_option('-e', '--encoding', default=settings['encoding'], help='Specify the encoding of a file (default is ' 'utf-8 or guessing if available)') parser.add_option('-b', '--open-browser', dest='open_browser', action='store_true', default=settings['open_browser'], help='Open the paste in a web browser') parser.add_option('-p', '--private', action='store_true', default=False, help='Paste as private') parser.add_option('--no-clipboard', dest='clipboard', action='store_false', default=settings['clipboard'], help="Don't copy the url into the clipboard") parser.add_option('--download', metavar='UID', help='Download a given paste') opts, args = parser.parse_args() # special modes of operation: # - paste script version if opts.version: print '%s: version %s' % (SCRIPT_NAME, VERSION) sys.exit() # - print list of languages elif opts.languages: print_languages() sys.exit() # - download Paste elif opts.download: download_paste(opts.download) sys.exit() # check language if given if opts.language and not language_exists(opts.language): fail('Language %s is not supported.' % opts.language, 3) # load file(s) try: data, language, filename, mimetype = compile_paste(args, opts.language) except Exception, err: fail('Error while reading the file(s): %s' % err, 2) if not data: fail('Aborted, no content to paste.', 4) # create paste code = make_utf8(data, opts.encoding) pid = create_paste(code, language, filename, mimetype, opts.private) url = '%sshow/%s/' % (SERVICE_URL, pid) print url if opts.open_browser: open_webbrowser(url) if opts.clipboard: copy_url(url) | b75206fd8de1f7f74e3150b949de916ec5b50ca3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11759/b75206fd8de1f7f74e3150b949de916ec5b50ca3/lodgeit.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6376,
2728,
1241,
1634,
12123,
225,
4084,
273,
7707,
5357,
30,
26510,
14654,
306,
2116,
65,
306,
3776,
1372,
13944,
82,
64,
82,
11,
296,
1994,
326,
1390,
471,
19401,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3536,
6376,
2728,
1241,
1634,
12123,
225,
4084,
273,
7707,
5357,
30,
26510,
14654,
306,
2116,
65,
306,
3776,
1372,
13944,
82,
64,
82,
11,
296,
1994,
326,
1390,
471,
19401,
3... |
source_dir = os.path.join(dir, "source", "class", "custom") | source_dir = os.path.join(app_dir, "source", "class", "custom") | def copySkeleton(skeleton_path, app_type, dir, namespace): console.log("Copy skeleton into the output directory: %s" % dir) template = os.path.join(skeleton_path, app_type) if not os.path.isdir(template): console.error("Unknown application type '%s'." % app_type) sys.exit(1) try: shutil.copytree(template, dir) except OSError: console.error("Failed to copy skeleton, maybe the directory already exists") sys.exit(1) # rename namespace source_dir = os.path.join(dir, "source", "class", "custom") if os.path.isdir(source_dir): os.rename( source_dir, os.path.join(dir, "source", "class", namespace) ) resource_dir = os.path.join(dir, "source", "resource", "custom") if os.path.isdir(resource_dir): os.rename( resource_dir, os.path.join(dir, "source", "resource", namespace) ) #clean svn directories for root, dirs, files in os.walk(dir, topdown=False): if ".svn" in dirs: filename = os.path.join(root, ".svn") shutil.rmtree(filename, ignore_errors=False, onerror=handleRemoveReadonly) | 9147a9ac90c662291742ddbed146c0b86318dbc6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/9147a9ac90c662291742ddbed146c0b86318dbc6/create-application.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
28070,
12,
7771,
12143,
67,
803,
16,
595,
67,
723,
16,
1577,
16,
1981,
4672,
2983,
18,
1330,
2932,
2951,
17761,
1368,
326,
876,
1867,
30,
738,
87,
6,
738,
1577,
13,
225,
1542,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
28070,
12,
7771,
12143,
67,
803,
16,
595,
67,
723,
16,
1577,
16,
1981,
4672,
2983,
18,
1330,
2932,
2951,
17761,
1368,
326,
876,
1867,
30,
738,
87,
6,
738,
1577,
13,
225,
1542,
... |
if ready : | if ready : | def _update(self, value): maxval = self.maxval if maxval == 0: # XXXX Quick fix. Should probably display an unknown duration value = 0 maxval = 1 if maxval > 32767: value = int(value/(maxval/32767.0)) maxval = 32767 progbar = self.d.GetDialogItemAsControl(3) progbar.SetControlMaximum(maxval) progbar.SetControlValue(value) # Test for cancel button ready, ev = Evt.WaitNextEvent( Events.mDownMask, 1 ) if ready : what,msg,when,where,mod = ev part = Win.FindWindow(where)[0] if Dlg.IsDialogEvent(ev): ds = Dlg.DialogSelect(ev) if ds[0] and ds[1] == self.d and ds[-1] == 1: self.w.HideWindow() self.w = None self.d = None raise KeyboardInterrupt, ev else: if part == 4: # inDrag self.w.DragWindow(where, screenbounds) else: MacOS.HandleEvent(ev) | 911e87de6f283e2326422c6746dd296511368a76 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/911e87de6f283e2326422c6746dd296511368a76/EasyDialogs.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2725,
12,
2890,
16,
460,
4672,
30443,
273,
365,
18,
1896,
1125,
309,
30443,
422,
374,
30,
468,
11329,
60,
19884,
2917,
18,
9363,
8656,
2562,
392,
5917,
3734,
460,
273,
374,
30443,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2725,
12,
2890,
16,
460,
4672,
30443,
273,
365,
18,
1896,
1125,
309,
30443,
422,
374,
30,
468,
11329,
60,
19884,
2917,
18,
9363,
8656,
2562,
392,
5917,
3734,
460,
273,
374,
30443,
... |
self.sendPacket(Xspeed, Rspeed, Tilt, Pan, Buttons) | self.sendPacket(Tilt, Pan, Xspeed, Rspeed, Buttons) | def onTimer(self, event=None): # configure output Xspeed = self.forward + 128 Rspeed = self.turn + 128 Pan = self.pan.GetValue() + 128 Tilt = self.tilt.GetValue() + 128 Buttons = 0 if self.selStrafe.GetValue(): Buttons = BUT_RT #print Xspeed, Rspeed, Pan, Tilt self.sendPacket(Xspeed, Rspeed, Tilt, Pan, Buttons) self.timer.Start(50) | 0751b9a7b60fdc8a3097c8cd657fc5150134312d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9859/0751b9a7b60fdc8a3097c8cd657fc5150134312d/commander.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
6777,
12,
2890,
16,
871,
33,
7036,
4672,
468,
5068,
876,
1139,
13871,
273,
365,
18,
11565,
397,
8038,
534,
13871,
273,
365,
18,
20922,
397,
8038,
12913,
273,
365,
18,
7355,
18,
96... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6777,
12,
2890,
16,
871,
33,
7036,
4672,
468,
5068,
876,
1139,
13871,
273,
365,
18,
11565,
397,
8038,
534,
13871,
273,
365,
18,
20922,
397,
8038,
12913,
273,
365,
18,
7355,
18,
96... |
names are defined in the ``language`` subpackage. """ | names are defined in the ``language`` subpackage.""" | def role_fn(name, rawtext, text, lineno, inliner): code... | edf51e38b3836f1a648b65216a4d06c1f619e4e6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8194/edf51e38b3836f1a648b65216a4d06c1f619e4e6/roles.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2478,
67,
4293,
12,
529,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
4672,
981,
2777,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2478,
67,
4293,
12,
529,
16,
1831,
955,
16,
977,
16,
7586,
16,
316,
7511,
264,
4672,
981,
2777,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
for col_id in col_range[1:]: | FIRST_ENTITY_ROW_POSN = 4 for row_id in row_range[FIRST_ENTITY_ROW_POSN:]: | def convert_spreadsheet_data_to_packages(self): # Note well, headings are in first column (columns are entities). cells = {} # - discover working area. max_row_id = 1 min_row_id = 1 max_col_id = 1 min_col_id = 1 for i, entry in enumerate(self.spreadsheet_data.entry): try: row_id = entry.cell.row col_id = entry.cell.col data = entry.content.text except Exception, inst: msg = "Couldn't read entry: %s" % inst msg += "\n%s" % entry raise Exception, msg try: row_id = int(row_id) col_id = int(col_id) except: continue cells[(row_id, col_id)] = data coords = cells.keys() coords.sort() row_ids = [i[0] for i in coords] col_ids = [i[1] for i in coords] top_left_coord = (min(row_ids), min(col_ids)) bottom_right_coord = (max(row_ids), max(col_ids)) row_range = range(top_left_coord[0], bottom_right_coord[1]+1) col_range = range(top_left_coord[1], bottom_right_coord[0]+1) self.raw_entities = [] self.headings = [] # - gather headings. for row_id in row_range: coord = (row_id, col_range[0]) if coord in cells: heading = cells[coord] else: heading = "" self.headings.append(heading) print "Headings: %s" % ", ".join(self.headings) # - gather entity attributes. for col_id in col_range[1:]: raw_entity = [] self.raw_entities.append(raw_entity) for row_id in row_range: coord = (row_id, col_id) if coord in cells: attribute = cells[coord] else: attribute = "" raw_entity.append(attribute) # - consolidate recorded entities. self.entities = [] for i, raw_entity in enumerate(self.raw_entities): entity = {} self.entities.append(entity) for j, value in enumerate(raw_entity): spreadsheet_name = self.headings[j] entity[spreadsheet_name] = value.strip() print " %s lines of data were found in the Spreadsheet." % len(self.entities) self.packages = [] # - construct packages. for entity in self.entities: if entity['Title'].strip() == "": continue package = {} self.packages.append(package) package_name = entity['Title'].lower() package_name = self.substitute_ascii_equivalents(package_name.decode('utf8')) package_name = "".join([c for c in package_name if c in string.letters+' ']) package_name = "-".join([s for s in package_name.split(' ') if s]) package['name'] = package_name package['title'] = entity['Title'] package['url'] = entity['Website'] package['maintainer'] = entity['Owner'] package['maintainer_email'] = entity['Email'] package['author'] = entity['Owner'] package['author_email'] = entity['Email'] notes = entity['Overview'] if entity['Details']: notes += "\n\n## Details\n" notes += entity['Details'] if entity['Contact']: notes += "\n\n## Contact\n" notes += entity['Contact'] if entity['Owner']: notes += "\n\n## Owner\n" notes += entity['Owner'] if entity['Operator']: notes += "\n\n## Operator\n" notes += entity['Operator'] if entity['Funding']: notes += "\n\n## Funding\n" notes += entity['Funding'] if entity['People']: notes += "\n\n## People\n" notes += entity['People'] if entity['Data Overview']: notes += "\n\n## Data Overview\n" notes += entity['Data Overview'] if entity['Database type']: notes += "\n\n## Database type\n" notes += entity['Database type'] #if entity['Is the data model standard?']: # notes += "\n\n## Is the Data Model Standard?\n" # notes += entity['Is the data model standard?'] if entity['Donor Type']: notes += "\n\n## Donor Type\n" notes += entity['Donor Type'] if entity['Donor Details']: notes += "\n\n## Donor Details\n" notes += entity['Donor Details'] if entity['Recipient Details']: notes += "\n\n## Recipient Details\n" notes += entity['Recipient Details'] if entity['Humanitarian Aid']: notes += "\n\n## Humanitarian Aid\n" notes += entity['Humanitarian Aid'] if entity['Development Aid']: notes += "\n\n## Development Aid\n" notes += entity['Development Aid'] if entity['Contents']: notes += "\n\n## Contents\n" notes += entity['Contents'] if entity['Data level']: notes += "\n\n## Data level\n" notes += entity['Data level'] if entity['Are there projects in the pipeline?']: notes += "\n\n## Are there projects in the pipeline?\n" notes += entity['Are there projects in the pipeline?'] if entity['Data broken down by sector?']: notes += "\n\n## Data broken down by sector?\n" notes += entity['Data broken down by sector?'] package['notes'] = notes package['tags'] = ["aidinfo"] package['extras'] = {'pipeline': '1', 'okd_compliance': '0'} print " %s data packages with titles were extracted from the Spreadsheet." % len(self.packages) | 49c24639d6db781a8e950b99747335a858ae6292 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/265/49c24639d6db781a8e950b99747335a858ae6292/aidinfo.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
26007,
8118,
67,
892,
67,
869,
67,
10308,
12,
2890,
4672,
468,
3609,
5492,
16,
910,
899,
854,
316,
1122,
1057,
261,
5112,
854,
5140,
2934,
5983,
273,
2618,
468,
300,
10372,
5... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
26007,
8118,
67,
892,
67,
869,
67,
10308,
12,
2890,
4672,
468,
3609,
5492,
16,
910,
899,
854,
316,
1122,
1057,
261,
5112,
854,
5140,
2934,
5983,
273,
2618,
468,
300,
10372,
5... |
self.noJobLimits(payload) | self.noJobLimits() | def __call__(self, event, payload): """ _operator()_ | 87d7e4aaef9a55485525200d47dab0552b5b83de /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8887/87d7e4aaef9a55485525200d47dab0552b5b83de/MergeSensorComponent.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
871,
16,
2385,
4672,
3536,
389,
9497,
1435,
67,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
1991,
972,
12,
2890,
16,
871,
16,
2385,
4672,
3536,
389,
9497,
1435,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-1... |
self.actions[self.mode].handle_key(self, key) | if key=='eh?': continue | def urwid_run(self): self.refresh_screen() while 1: ## We are a generator and we are ready for more input keys = self.ui.get_input((yield "Ready")) | 7fee5cf916e6d2eba03c5abc5adc14cc0c8404e0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5568/7fee5cf916e6d2eba03c5abc5adc14cc0c8404e0/Hexeditor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8896,
30902,
67,
2681,
12,
2890,
4672,
365,
18,
9144,
67,
9252,
1435,
1323,
404,
30,
7541,
1660,
854,
279,
4456,
471,
732,
854,
5695,
364,
1898,
810,
1311,
273,
365,
18,
4881,
18,
588,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8896,
30902,
67,
2681,
12,
2890,
4672,
365,
18,
9144,
67,
9252,
1435,
1323,
404,
30,
7541,
1660,
854,
279,
4456,
471,
732,
854,
5695,
364,
1898,
810,
1311,
273,
365,
18,
4881,
18,
588,... |
print "no hypocenter data." | err = "Error: No hypocenter data!" appendTextview(self.textviewStdErr, err) | def showEventMap(self): if self.dictOrigin == {}: print "no hypocenter data." return #print self.dicts[0] self.figEventMap = plt.figure(1000) self.figEventMap.canvas.set_window_title("Event Map") self.axEventMap = self.figEventMap.add_subplot(111) self.axEventMap.scatter([self.dictOrigin['Longitude']], [self.dictOrigin['Latitude']], 30, color = 'red', marker = 'o') errLon, errLat = utlLonLat(self.dictOrigin['Longitude'], self.dictOrigin['Latitude'], self.dictOrigin['Longitude Error'], self.dictOrigin['Latitude Error']) errLon -= self.dictOrigin['Longitude'] errLat -= self.dictOrigin['Latitude'] self.axEventMap.text(self.dictOrigin['Longitude'], self.dictOrigin['Latitude'], ' %7.3f +/- %0.2fkm\n' % \ (self.dictOrigin['Longitude'], self.dictOrigin['Longitude Error']) + \ ' %7.3f +/- %0.2fkm\n' % \ (self.dictOrigin['Latitude'], self.dictOrigin['Latitude Error']) + \ ' %.1fkm +/- %.1fkm' % \ (self.dictOrigin['Depth'], self.dictOrigin['Depth Error']), va = 'top', family = 'monospace') try: self.netMagLabel = '\n\n\n\n %.2f (Var: %.2f)' % (self.dictMagnitude['Magnitude'], self.dictMagnitude['Uncertainty']) self.netMagText = self.axEventMap.text(self.dictOrigin['Longitude'], self.dictOrigin['Latitude'], self.netMagLabel, va = 'top', color = 'green', family = 'monospace') except: pass errorell = Ellipse(xy = [self.dictOrigin['Longitude'], self.dictOrigin['Latitude']], width = errLon, height = errLat, angle = 0, fill = False) self.axEventMap.add_artist(errorell) self.scatterMagIndices = [] self.scatterMagLon = [] self.scatterMagLat = [] for i in range(len(self.streams)): # determine which stations are used in location if self.dicts[i].has_key('Pres') or self.dicts[i].has_key('Sres'): stationColor = 'black' else: stationColor = 'gray' # plot stations at respective coordinates with names self.axEventMap.scatter([self.dicts[i]['StaLon']], [self.dicts[i]['StaLat']], s = 150, marker = 'v', color = '', edgecolor = stationColor) self.axEventMap.text(self.dicts[i]['StaLon'], self.dicts[i]['StaLat'], ' ' + self.dicts[i]['Station'], color = stationColor, va = 'top', family = 'monospace') if self.dicts[i].has_key('Pres'): presinfo = '\n\n %+0.3fs' % self.dicts[i]['Pres'] if self.dicts[i].has_key('PPol'): presinfo += ' %s' % self.dicts[i]['PPol'] self.axEventMap.text(self.dicts[i]['StaLon'], self.dicts[i]['StaLat'], presinfo, va = 'top', family = 'monospace', color = self.dictPhaseColors['P']) if self.dicts[i].has_key('Sres'): sresinfo = '\n\n\n %+0.3fs' % self.dicts[i]['Sres'] if self.dicts[i].has_key('SPol'): sresinfo += ' %s' % self.dicts[i]['SPol'] self.axEventMap.text(self.dicts[i]['StaLon'], self.dicts[i]['StaLat'], sresinfo, va = 'top', family = 'monospace', color = self.dictPhaseColors['S']) if self.dicts[i].has_key('Mag'): self.scatterMagIndices.append(i) self.scatterMagLon.append(self.dicts[i]['StaLon']) self.scatterMagLat.append(self.dicts[i]['StaLat']) self.axEventMap.text(self.dicts[i]['StaLon'], self.dicts[i]['StaLat'], ' ' + self.dicts[i]['Station'], va = 'top', family = 'monospace') self.axEventMap.text(self.dicts[i]['StaLon'], self.dicts[i]['StaLat'], '\n\n\n\n %0.2f (%s)' % (self.dicts[i]['Mag'], self.dicts[i]['MagChannel']), va = 'top', family = 'monospace', color = self.dictPhaseColors['Mag']) if len(self.scatterMagLon) > 0 : self.scatterMag = self.axEventMap.scatter(self.scatterMagLon, self.scatterMagLat, s = 150, marker = 'v', color = '', edgecolor = 'black', picker = 10) self.axEventMap.set_xlabel('Longitude') self.axEventMap.set_ylabel('Latitude') self.axEventMap.set_title(self.dictOrigin['Time']) self.axEventMap.axis('equal') #XXX disabled because it plots the wrong info if the event was # fetched from seishub #####lines = open(self.threeDlocOutfile).readlines() #####infoEvent = lines[0].rstrip() #####infoPicks = '' #####for line in lines[1:]: ##### infoPicks += line #####self.axEventMap.text(0.02, 0.95, infoEvent, transform = self.axEventMap.transAxes, ##### fontsize = 12, verticalalignment = 'top', ##### family = 'monospace') #####self.axEventMap.text(0.02, 0.90, infoPicks, transform = self.axEventMap.transAxes, ##### fontsize = 10, verticalalignment = 'top', ##### family = 'monospace') self.figEventMap.canvas.mpl_connect('pick_event', self.selectMagnitudes) try: self.scatterMag.set_facecolors(self.eventMapColors) except: pass plt.show() | 4e8f536428831ce605c623aa5fc17a6b33b5b712 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/4e8f536428831ce605c623aa5fc17a6b33b5b712/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
1133,
863,
12,
2890,
4672,
309,
365,
18,
1576,
7571,
422,
16648,
393,
273,
315,
668,
30,
2631,
16117,
504,
2328,
501,
4442,
714,
1528,
1945,
12,
2890,
18,
955,
1945,
10436,
2524,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2405,
1133,
863,
12,
2890,
4672,
309,
365,
18,
1576,
7571,
422,
16648,
393,
273,
315,
668,
30,
2631,
16117,
504,
2328,
501,
4442,
714,
1528,
1945,
12,
2890,
18,
955,
1945,
10436,
2524,
... |
finally: sys.stderr = save_stderr | self.assertEqual(s.getvalue(), '') | def __del__(self_): self.assertEqual(self_.a, 1) self.assertEqual(self_.b, 2) | ee74da60c4104038c887d3f6ca003441b0006134 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/ee74da60c4104038c887d3f6ca003441b0006134/test_descr.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
67,
4672,
365,
18,
11231,
5812,
12,
2890,
27799,
69,
16,
404,
13,
365,
18,
11231,
5812,
12,
2890,
27799,
70,
16,
576,
13,
2,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3771,
972,
12,
2890,
67,
4672,
365,
18,
11231,
5812,
12,
2890,
27799,
69,
16,
404,
13,
365,
18,
11231,
5812,
12,
2890,
27799,
70,
16,
576,
13,
2,
-100,
-100,
-100,
-100,
-100,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.