rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
had_err = gtlib.gt_layout_sketch(self.layout, canvas)
had_err = gtlib.gt_layout_sketch(self.layout, canvas, err)
def sketch(self, canvas): err = Error() had_err = gtlib.gt_layout_sketch(self.layout, canvas) if had_err < 0: gterror(err)
6a98cf9c365b3a2161377f838610a10f2beba003 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8905/6a98cf9c365b3a2161377f838610a10f2beba003/layout.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18534, 12, 2890, 16, 5953, 4672, 393, 273, 1068, 1435, 9323, 67, 370, 273, 9879, 2941, 18, 4521, 67, 6741, 67, 7771, 1593, 12, 2890, 18, 6741, 16, 5953, 16, 393, 13, 309, 9323, 67, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18534, 12, 2890, 16, 5953, 4672, 393, 273, 1068, 1435, 9323, 67, 370, 273, 9879, 2941, 18, 4521, 67, 6741, 67, 7771, 1593, 12, 2890, 18, 6741, 16, 5953, 16, 393, 13, 309, 9323, 67, 3...
os.path.mkdir(root+"tmp",01777)
os.mkdir(root+"tmp",01777)
def ebuild_init(): "performs db/variable initialization for the ebuild system. Not required for other scripts." global local_virts, root_virts, roottree, localtree, ebuild_initialized, root, virtuals local_virts=getvirtuals("/") if root=="/": root_virts=local_virts else: root_virts=getvirtuals(root) localtree=vartree("/",local_virts) if root=="/": roottree=localtree else: roottree=vartree(root,root_virts) ebuild_initialized=1
e3cdbc2372f382c229a43d2a8af14fe084778b3a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2807/e3cdbc2372f382c229a43d2a8af14fe084778b3a/portage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 425, 3510, 67, 2738, 13332, 315, 457, 9741, 1319, 19, 6105, 10313, 364, 326, 425, 3510, 2619, 18, 225, 2288, 1931, 364, 1308, 8873, 1199, 2552, 1191, 67, 14035, 87, 16, 1365, 67, 14035, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 425, 3510, 67, 2738, 13332, 315, 457, 9741, 1319, 19, 6105, 10313, 364, 326, 425, 3510, 2619, 18, 225, 2288, 1931, 364, 1308, 8873, 1199, 2552, 1191, 67, 14035, 87, 16, 1365, 67, 14035, ...
value = load_translations().ungettext(s1, s2, n)
translations = load_translations(web.ctx.get('lang', 'en')) value = (translations and translations.ungettext(s1, s2, n))
def ungettext(s1, s2, n): value = load_translations().ungettext(s1, s2, n) if value: return value else: # fallback when translation is not provided if n == 1: return s1 else: return s2
0f4cede4c3f9c794ac9d709527393533d7453b07 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3913/0f4cede4c3f9c794ac9d709527393533d7453b07/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 640, 29967, 12, 87, 21, 16, 272, 22, 16, 290, 4672, 7863, 273, 1262, 67, 13457, 12, 4875, 18, 5900, 18, 588, 2668, 4936, 2187, 296, 275, 26112, 460, 273, 261, 13457, 471, 7863, 18, 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, 640, 29967, 12, 87, 21, 16, 272, 22, 16, 290, 4672, 7863, 273, 1262, 67, 13457, 12, 4875, 18, 5900, 18, 588, 2668, 4936, 2187, 296, 275, 26112, 460, 273, 261, 13457, 471, 7863, 18, 3...
self.c.execute("INSERT INTO Historikk (ordreID, dato, handlingID, suksess, forklaring) VALUES (?,?,?,?,?)", (self.ordreID, self.dato, self.handlingID, self.suksess & 1, self.forklaring))
self.c.execute("INSERT INTO Historikk (ordreID, dato, handlingID, suksess, forklaring) VALUES (?,?,?,?,?)", (self.ordreID, self.dato, self.handlingID, (self.suksess and 1) or 0, self.forklaring))
def registrerHandling(self): #skriver til databasen self.c.execute("INSERT INTO Historikk (ordreID, dato, handlingID, suksess, forklaring) VALUES (?,?,?,?,?)", (self.ordreID, self.dato, self.handlingID, self.suksess & 1, self.forklaring)) self.db.commit()
78bea9b5a405622c8da7e179c52b71fccce38574 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3611/78bea9b5a405622c8da7e179c52b71fccce38574/historikk.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17450, 264, 14701, 12, 2890, 4672, 468, 7771, 2100, 268, 330, 10481, 345, 275, 365, 18, 71, 18, 8837, 2932, 11356, 12421, 13244, 280, 1766, 79, 261, 517, 266, 734, 16, 1150, 83, 16, 50...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 17450, 264, 14701, 12, 2890, 4672, 468, 7771, 2100, 268, 330, 10481, 345, 275, 365, 18, 71, 18, 8837, 2932, 11356, 12421, 13244, 280, 1766, 79, 261, 517, 266, 734, 16, 1150, 83, 16, 50...
filename = '<codegen %r %s:%d>' % (filename, fn, lineno)
filename = base + '%r %s:%d>' % (filename, fn, lineno)
def compile(self, filename=None, mode='exec', flag=generators.compiler_flag, dont_inherit=0, _genframe=None): """ return compiled code object. if filename is None invent an artificial filename which displays the source/line position of the caller frame. """ if not filename or py.path.local(filename).check(file=0): if _genframe is None: _genframe = sys._getframe(1) # the caller fn,lineno = _genframe.f_code.co_filename, _genframe.f_lineno if not filename: filename = '<codegen %s:%d>' % (fn, lineno) else: filename = '<codegen %r %s:%d>' % (filename, fn, lineno) source = "\n".join(self.lines) + '\n' try: co = cpy_compile(source, filename, mode, flag) except SyntaxError: ex = sys.exc_info()[1] # re-represent syntax errors from parsing python strings msglines = self.lines[:ex.lineno] if ex.offset: msglines.append(" "*ex.offset + '^') msglines.append("syntax error probably generated here: %s" % filename) newex = SyntaxError('\n'.join(msglines)) newex.offset = ex.offset newex.lineno = ex.lineno newex.text = ex.text raise newex else: if flag & _AST_FLAG: return co lines = [(x + "\n") for x in self.lines] if sys.version_info[0] >= 3: # XXX py3's inspect.getsourcefile() checks for a module # and a pep302 __loader__ ... we don't have a module # at code compile-time so we need to fake it here m = ModuleType("_pycodecompile_pseudo_module") py.std.inspect.modulesbyfile[filename] = None py.std.sys.modules[None] = m m.__loader__ = 1 py.std.linecache.cache[filename] = (1, None, lines, filename) return co
95e4ad2aad101c653f898260c75cf645966d6871 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/95e4ad2aad101c653f898260c75cf645966d6871/source.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 12, 2890, 16, 1544, 33, 7036, 16, 1965, 2218, 4177, 2187, 2982, 33, 25959, 18, 9576, 67, 6420, 16, 14046, 67, 6018, 33, 20, 16, 389, 4507, 3789, 33, 7036, 4672, 3536, 327, 7743, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4074, 12, 2890, 16, 1544, 33, 7036, 16, 1965, 2218, 4177, 2187, 2982, 33, 25959, 18, 9576, 67, 6420, 16, 14046, 67, 6018, 33, 20, 16, 389, 4507, 3789, 33, 7036, 4672, 3536, 327, 7743, ...
self.doclist.Delete(entry.GetEditLink().href) class DocumentListUpdateTest(unittest.TestCase): def setUp(self): client_login() self.doclist = client
self.editClient.Delete(entry.GetEditLink().href) class DocumentListUpdateTest(DocumentsListServiceTest): def setUp(self): DocumentsListServiceTest.setUp(self)
def testUploadAndDeleteSpreadsheet(self): ms = gdata.MediaSource(file_path='test.csv', content_type='text/csv') entry = self.doclist.UploadSpreadsheet(ms, 'test spreadsheet') self.assert_(entry.title.text == 'test spreadsheet') self.assertEqual(entry.category[0].label, 'spreadsheet') self.assert_(isinstance(entry, gdata.docs.DocumentListEntry)) self.doclist.Delete(entry.GetEditLink().href)
76de6e666a2dc6ba3f703b89b870266619bcabd4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10620/76de6e666a2dc6ba3f703b89b870266619bcabd4/service_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 4777, 1876, 2613, 28719, 8118, 12, 2890, 4672, 4086, 273, 314, 892, 18, 5419, 1830, 12, 768, 67, 803, 2218, 3813, 18, 6715, 2187, 913, 67, 723, 2218, 955, 19, 6715, 6134, 1241, 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, 1842, 4777, 1876, 2613, 28719, 8118, 12, 2890, 4672, 4086, 273, 314, 892, 18, 5419, 1830, 12, 768, 67, 803, 2218, 3813, 18, 6715, 2187, 913, 67, 723, 2218, 955, 19, 6715, 6134, 1241, 2...
self.jsEnv.attachListener(self) self.jsfilter = HtmlFilter(self.rules, self.document, comments=self.comments, javascript=self.javascript) self.jsEnv.executeScript(script, 0.0) self.jsEnv.detachListener(self) self.jsfilter.flush() self.buffer.append([DATA, self.jsfilter.flushbuf()]) self.buffer += self.jsfilter.buffer self.jsfilter = None
if not script: return self.jsScript(script, 0.0)
def jsEndElement (self, tag): """parse generated html for scripts""" if not self.buffer: print >>sys.stderr, "empty buffer on </script>" return if self.buffer[-1][0]!=DATA: print >>sys.stderr, "missing data for </script>", self.buffer[-1:] return script = self.buffer[-1][1].strip() del self.buffer[-1] if not (self.buffer and self.buffer[-1][0]==STARTTAG and \ self.buffer[1][1]=='script'): # there was a <script src="..."> already return del self.buffer[-1] if not script: return if script.startswith("<!--"): script = script[4:].strip() self.jsEnv.attachListener(self) self.jsfilter = HtmlFilter(self.rules, self.document, comments=self.comments, javascript=self.javascript) self.jsEnv.executeScript(script, 0.0) self.jsEnv.detachListener(self) self.jsfilter.flush() self.buffer.append([DATA, self.jsfilter.flushbuf()]) self.buffer += self.jsfilter.buffer self.jsfilter = None
ac3470728f7e970a92ce929b4fa85ae2f5e5d4ae /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/ac3470728f7e970a92ce929b4fa85ae2f5e5d4ae/Rewriter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3828, 1638, 1046, 261, 2890, 16, 1047, 4672, 3536, 2670, 4374, 1729, 364, 8873, 8395, 309, 486, 365, 18, 4106, 30, 1172, 1671, 9499, 18, 11241, 16, 315, 5531, 1613, 603, 7765, 4263, 2984...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3828, 1638, 1046, 261, 2890, 16, 1047, 4672, 3536, 2670, 4374, 1729, 364, 8873, 8395, 309, 486, 365, 18, 4106, 30, 1172, 1671, 9499, 18, 11241, 16, 315, 5531, 1613, 603, 7765, 4263, 2984...
site = wikipedia.getSite(family(wiki))
site = wikipedia.getSite(*family(wiki)) namespace_name = site.namespace(namespace) if namespace_name: namespace_name = namespace_name + u':' else: namespace_name = u''
def report(self, (old_image, new_image, user, comment, not_ok)): not_ok_items = [] for wiki, namespace, page_title in not_ok: # Threadsafety? site = wikipedia.getSite(family(wiki)) if unicode(site) == unicode(self.site): if (namespace, page_title) != (6, old_image): not_ok_items.append(u'[[:%s:%s]]' % \ (site.namespace(namespace), page_title)) else: not_ok_items.append(u'[[:%s:%s:%s]]' % (site_prefix(site), site.namespace(namespace), page_title)) template = u'{{%s|new_image=%s|user=%s|comment=%s|not_ok=%s}}' % \ (self.config['replacer_report_template'], new_image, user, comment, self.config.get('replacer_report_seperator', u', ').join(not_ok_items)) page = wikipedia.Page(self.site, u'Image:' + old_image) text = page.get() try: page.put(u'%s\n%s' % (template, text), comment = u'This image has been replaced by ' + new_image) except PageNotSaved, e: output(u'Warning! Unable to report replacement to %s.' % old_image, False) output('%s: %s' % (e.__class__.__name__, str(e)), False) else: output(u'Reporting replacement of %s by %s.' % \ (old_image, new_image))
620c7fca53054af0c5b2b62245d8fd3c73e619c1 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/620c7fca53054af0c5b2b62245d8fd3c73e619c1/image_replacer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2605, 12, 2890, 16, 261, 1673, 67, 2730, 16, 394, 67, 2730, 16, 729, 16, 2879, 16, 486, 67, 601, 3719, 30, 486, 67, 601, 67, 3319, 273, 5378, 364, 9050, 16, 1981, 16, 1363, 67, 264...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2605, 12, 2890, 16, 261, 1673, 67, 2730, 16, 394, 67, 2730, 16, 729, 16, 2879, 16, 486, 67, 601, 3719, 30, 486, 67, 601, 67, 3319, 273, 5378, 364, 9050, 16, 1981, 16, 1363, 67, 264...
self.SetDlgItemText(IDC_EDIT_CERTAIN, "%d" % self.mgr.config.filter.spam_threshold)
self.SetDlgItemText(IDC_EDIT_CERTAIN, "%s" % self.mgr.config.filter.spam_threshold)
def OnInitDialog(self): self.SetDlgItemText(IDC_EDIT_CERTAIN, "%d" % self.mgr.config.filter.spam_threshold) self.HookCommand(self.OnEditChange, IDC_EDIT_CERTAIN) self.SetDlgItemText(IDC_EDIT_UNSURE, "%d" % self.mgr.config.filter.unsure_threshold) self.HookCommand(self.OnEditChange, IDC_EDIT_UNSURE)
8d074e12ade7e39e55edeb9dd22f659d21cc14c8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/8d074e12ade7e39e55edeb9dd22f659d21cc14c8/FilterDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2755, 2570, 6353, 12, 2890, 4672, 365, 18, 694, 40, 23623, 1180, 1528, 12, 734, 39, 67, 10776, 67, 22367, 6964, 16, 2213, 87, 6, 738, 365, 18, 13552, 18, 1425, 18, 2188, 18, 1752, 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, 2755, 2570, 6353, 12, 2890, 4672, 365, 18, 694, 40, 23623, 1180, 1528, 12, 734, 39, 67, 10776, 67, 22367, 6964, 16, 2213, 87, 6, 738, 365, 18, 13552, 18, 1425, 18, 2188, 18, 1752, 30...
def close(self): self.write() self.write_rej()
def write(self, dest=None): if not self.dirty: return if not dest: dest = self.fname self.writelines(dest, self.lines)
a16dc89094a3e839457d1571ecc29e65d90ac35a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11312/a16dc89094a3e839457d1571ecc29e65d90ac35a/patch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 12, 2890, 16, 1570, 33, 7036, 4672, 309, 486, 365, 18, 18013, 30, 327, 309, 486, 1570, 30, 1570, 273, 365, 18, 12749, 365, 18, 5363, 14567, 12, 10488, 16, 365, 18, 3548, 13, 2,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1045, 12, 2890, 16, 1570, 33, 7036, 4672, 309, 486, 365, 18, 18013, 30, 327, 309, 486, 1570, 30, 1570, 273, 365, 18, 12749, 365, 18, 5363, 14567, 12, 10488, 16, 365, 18, 3548, 13, 2,...
pdbStreamFile.write('''SRCSRV: ini ------------------------------------------------\r\nVERSION=1\r\nSRCSRV: variables ------------------------------------------\r\nCVS_EXTRACT_CMD=%fnchdir%(%CVS_WORKINGDIR%)cvs.exe -d %fnvar%(%var2%) checkout -r %var4% %var3%\r\nCVS_EXTRACT_TARGET=%targ%\%var2%\%fnbksl%(%var3%)\%fnfile%(%var1%)\r\nCVS_WORKING_DIR=%targ%\r\nMYSERVER=''') pdbStreamFile.write(cvs_root) pdbStreamFile.write('''\r\nSRCSRVTRG=%targ%\%fnbksl%(%var3%)\r\nSRCSRVCMD=%CVS_EXTRACT_CMD%\r\nSRCSRV: source files ---------------------------------------\r\n''')
pdbStreamFile.write('''SRCSRV: ini ------------------------------------------------\r\nVERSION=1\r\nSRCSRV: variables ------------------------------------------\r\nCVS_EXTRACT_CMD=%fnchdir%(%CVS_WORKINGDIR%)cvs.exe -d %fnvar%(%var2%) checkout -r %var4% %var3%\r\nCVS_EXTRACT_TARGET=%targ%\%var2%\%fnbksl%(%var3%)\%fnfile%(%var1%)\r\nCVS_WORKING_DIR=%targ%\%var2%\%fnbksl%(%var3%)\r\nMYSERVER=%CVSROOT%\r\nSRCSRVTRG=%CVS_WORKING_DIR%\r\nSRCSRVCMD=%CVS_EXTRACT_CMD%\r\nSRCSRV: source files ---------------------------------------\r\n''')
def SourceIndex(fileStream, outputPath, cvs_root): """Takes a list of files, writes info to a data block in a .stream file""" # Creates a .pdb.stream file in the mozilla\objdir to be used for source indexing # Create the srcsrv data block that indexes the pdb file result = True pdbStreamFile = open(outputPath, "w") pdbStreamFile.write('''SRCSRV: ini ------------------------------------------------\r\nVERSION=1\r\nSRCSRV: variables ------------------------------------------\r\nCVS_EXTRACT_CMD=%fnchdir%(%CVS_WORKINGDIR%)cvs.exe -d %fnvar%(%var2%) checkout -r %var4% %var3%\r\nCVS_EXTRACT_TARGET=%targ%\%var2%\%fnbksl%(%var3%)\%fnfile%(%var1%)\r\nCVS_WORKING_DIR=%targ%\r\nMYSERVER=''') pdbStreamFile.write(cvs_root) pdbStreamFile.write('''\r\nSRCSRVTRG=%targ%\%fnbksl%(%var3%)\r\nSRCSRVCMD=%CVS_EXTRACT_CMD%\r\nSRCSRV: source files ---------------------------------------\r\n''') pdbStreamFile.write(fileStream) # can't do string interpolation because the source server also uses this and so there are % in the above pdbStreamFile.write("SRCSRV: end ------------------------------------------------\r\n\n") pdbStreamFile.close() return result
f2bf6ea473a0cac3b3fe5d4110109b73188f4d73 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11102/f2bf6ea473a0cac3b3fe5d4110109b73188f4d73/symbolstore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4998, 1016, 12, 768, 1228, 16, 19566, 16, 276, 6904, 67, 3085, 4672, 3536, 11524, 279, 666, 434, 1390, 16, 7262, 1123, 358, 279, 501, 1203, 316, 279, 263, 3256, 585, 8395, 468, 10210, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4998, 1016, 12, 768, 1228, 16, 19566, 16, 276, 6904, 67, 3085, 4672, 3536, 11524, 279, 666, 434, 1390, 16, 7262, 1123, 358, 279, 501, 1203, 316, 279, 263, 3256, 585, 8395, 468, 10210, ...
matchList = matchSrcAndCatalogue(cat=cat, img=srcSet, wcs=wcs,
matchList = matchSrcAndCatalogue(cat=cat, img=srcSet, wcs=wcs,
def determineWcs(policy, exposure, sourceSet, log=None, solver=None, doTrim=False, forceImageSize=None): """Top level function for calculating a Wcs. Given an initial guess at a Wcs (hidden inside an exposure) and a set of sources (sourceSet), use astrometry.net to confirm the Wcs, then calculate distortion terms. Input: policy: An lsst.pex.policy.Policy object containing the parameters for the solver exposure lsst.afw.image.Exposure representation of an image and a wcs this provides the initial guess at position and plate scale sourceSet A list of lsst.afw.detection.Source objects, indicating the pixel positions of stars in the field log A lsst.pex.logging.Log object (optional), used for printing progress doTrim Check that all sources lie within the image, and remove those that don't. solver Optionally provide a previously created astrometry.net solver. If not provided one will be created. forceImageSize tuple of (W,H): force this image size, rather than getting it from the Exposure. """ if log is None: #log = StdoutLog() #Write log messages to stdout log = Log.getDefaultLog() log.log(Log.INFO, "In determineWcs") #Short names exp = exposure srcSet = sourceSet if display: frame = 1 ds9.mtv(exposure, frame=frame, title="wcsDet") if doTrim: nStart = len(srcSet) srcSet = trimBadPoints(exp, srcSet) if log: nEnd = len(srcSet) log.log(log.DEBUG, "Kept %i of %i sources after trimming" %(nEnd, nStart)) if display: for s in srcSet: ds9.dot("o", s.getXAstrom(), s.getYAstrom(), size=3, ctype=ds9.RED, frame=frame) #Extract an initial guess wcs if available wcsIn = exp.getWcs() #May be None # Exposure uses the special object "NoWcs" instead of NULL. Because they're special. haswcs = exp.hasWcs() if not haswcs: log.log(log.WARN, "No wcs found on exposure. Doing blind solve") #Setup solver if solver is None: path=os.path.join(os.environ['ASTROMETRY_NET_DATA_DIR'], "metadata.paf") solver = astromNet.GlobalAstrometrySolution(path, log) matchThreshold = policy.get('matchThreshold') solver.setMatchThreshold(matchThreshold) else: solver.reset() #Set solving params log.log(log.DEBUG, "Setting starlist") solver.setStarlist(srcSet) log.log(log.DEBUG, "Setting numBrightObj") solver.setNumBrightObjects( min(policy.get('numBrightStars'), len(srcSet))) if forceImageSize is not None: (W,H) = forceImageSize else: (W,H) = (exp.getWidth(), exp.getHeight()) solver.setImageSize(W, H) solver.setLogLevel(2) #solver.printSolverSettings(stdout) # FIXME -- add policy entry for this... #dscale = policy.get('pixelScaleUncertainty') dscale = None #Do a blind solve if we're told to, or if we don't have an input wcs doBlindSolve = policy.get('blindSolve') or (not haswcs) if doBlindSolve: log.log(log.DEBUG, "Solving with no initial guess at position") isSolved = solver.solve() elif dscale is not None: isSolved = solver.solve(wcsIn, dscale) else: isSolved = solver.solve(wcsIn) #Did we solve? log.log(log.DEBUG, "Finished Solve step.") if not isSolved: log.log(log.WARN, "No solution found, using input Wcs") return [], wcsIn wcs = solver.getWcs() # # Generate a list of catalogue objects in the field. # #First obtain the catalogue-listed positions of stars log.log(log.DEBUG, "Determining match objects") imgSizeInArcsec = wcs.pixelScale() * hypot(W,H) #Do we want magnitude information filterName = chooseFilterName(exposure, policy, solver, log) try: cat = solver.getCatalogue(2*imgSizeInArcsec, filterName) except LsstCppException, e: log.log(Log.WARN, str(e)) log.log(Log.WARN, "Attempting to access catalogue positions and fluxes") version = os.environ['ASTROMETRY_NET_DATA_DIR'] log.log(Log.WARN, "Catalogue version: %s" %(version)) log.log(Log.WARN, "Requested filter: %s" %(filterName)) log.log(Log.WARN, "Available filters: " + str(solver.getCatalogueMetadataFields())) raise matchList=[] #Make sure this stays in scope if True: #Now generate a list of matching objects distInArcsec = policy.get('distanceForCatalogueMatchinArcsec') cleanParam = policy.get('cleaningParameter') matchList = matchSrcAndCatalogue(cat=cat, img=srcSet, wcs=wcs, distInArcsec=distInArcsec, cleanParam=cleanParam) uniq = set([sm.second.getId() for sm in matchList]) if len(matchList) != len(uniq): log.log(Log.WARN, "The list of matches stars contains duplicated reference sources (%i sources, %i unique ids)" % (len(matchList), len(uniq))) if len(matchList) == 0: log.log(Log.WARN, "No matches found between input source and catalogue.") log.log(Log.WARN, "Something in wrong. Defaulting to input wcs") return [], wcsIn log.log(Log.DEBUG, "%i catalogue objects match input source list using linear Wcs" %(len(matchList))) else: #Use list of matches returned by astrometry.net log.log(Log.DEBUG, "Getting matched sources: Fluxes in band %s " %(filterName)) matchList = solver.getMatchedSources(filterName) if policy.get('calculateSip'): sipOrder = policy.get('sipOrder') wcs, matchList = calculateSipTerms(wcs, cat, srcSet, distInArcsec, cleanParam, sipOrder, log) else: log.log(Log.DEBUG, "Updating wcs in input exposure with linear wcs") exposure.setWcs(wcs) #solver.reset() if display: for s1, s2, d in matchList: # plot the catalogue positions ds9.dot("+", s1.getXAstrom(), s1.getYAstrom(), size=3, ctype=ds9.BLUE, frame=frame) return [matchList, wcs]
684b3a5387671c1befd6e88a491a5a10992a7c05 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6522/684b3a5387671c1befd6e88a491a5a10992a7c05/determineWcs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4199, 59, 2143, 12, 5086, 16, 14620, 16, 1084, 694, 16, 613, 33, 7036, 16, 12776, 33, 7036, 16, 741, 14795, 33, 8381, 16, 2944, 28576, 33, 7036, 4672, 3536, 3401, 1801, 445, 364, 21046...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4199, 59, 2143, 12, 5086, 16, 14620, 16, 1084, 694, 16, 613, 33, 7036, 16, 12776, 33, 7036, 16, 741, 14795, 33, 8381, 16, 2944, 28576, 33, 7036, 4672, 3536, 3401, 1801, 445, 364, 21046...
exts.append( Extension('resource', ['resource.c']) )
if platform not in ['cygwin']: exts.append( Extension('resource', ['resource.c']) )
def detect_modules(self): # Ensure that /usr/local is always used if '/usr/local/lib' not in self.compiler.library_dirs: self.compiler.library_dirs.append('/usr/local/lib') if '/usr/local/include' not in self.compiler.include_dirs: self.compiler.include_dirs.append( '/usr/local/include' )
1cfa0e8295f3d8749eba860c3e99f12d18bfbee3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/1cfa0e8295f3d8749eba860c3e99f12d18bfbee3/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, 309, 1173, 13640, 19, 3729, 19, 2941, 11, 486, 316, 365, 18, 9576, 18, 12083, 67, 8291, 30, 365, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 5966, 67, 6400, 12, 2890, 4672, 468, 7693, 716, 342, 13640, 19, 3729, 353, 3712, 1399, 309, 1173, 13640, 19, 3729, 19, 2941, 11, 486, 316, 365, 18, 9576, 18, 12083, 67, 8291, 30, 365, ...
def _CreateBlockDevOnSecondary(cfg, node, instance, device, force, info):
def _CreateBlockDevOnSecondary(lu, node, instance, device, force, info):
def _CreateBlockDevOnSecondary(cfg, node, instance, device, force, info): """Create a tree of block devices on a secondary node. If this device type has to be created on secondaries, create it and all its children. If not, just recurse to children keeping the same 'force' value. """ if device.CreateOnSecondary(): force = True if device.children: for child in device.children: if not _CreateBlockDevOnSecondary(cfg, node, instance, child, force, info): return False if not force: return True cfg.SetDiskID(device, node) new_id = rpc.call_blockdev_create(node, device, device.size, instance.name, False, info) if not new_id: return False if device.physical_id is None: device.physical_id = new_id return True
b9bddb6bdf7ac5841c732845ce0122c64bb026b1 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7542/b9bddb6bdf7ac5841c732845ce0122c64bb026b1/cmdlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1684, 1768, 8870, 1398, 14893, 12, 28832, 16, 756, 16, 791, 16, 2346, 16, 2944, 16, 1123, 4672, 3536, 1684, 279, 2151, 434, 1203, 7166, 603, 279, 9946, 756, 18, 225, 971, 333, 234...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1684, 1768, 8870, 1398, 14893, 12, 28832, 16, 756, 16, 791, 16, 2346, 16, 2944, 16, 1123, 4672, 3536, 1684, 279, 2151, 434, 1203, 7166, 603, 279, 9946, 756, 18, 225, 971, 333, 234...
wikipedia.output(text[max(0, match.start() - context) : match.start()] + '\03{lightred}' + text[match.start() : match.end()] + '\03{default}' + text[match.end() : match.end() + context]) choice = wikipedia.inputChoice(u'\nWhat shall be done with this link?', ['unlink', 'skip', 'edit', 'more context'], ['U', 's', 'e', 'm'], 'u') wikipedia.output(u'')
if self.always: choice = 'a' else: wikipedia.output( text[max(0, match.start() - context) : match.start()] \ + '\03{lightred}' + text[match.start() : match.end()] \ + '\03{default}' + text[match.end() : match.end() + context]) choice = wikipedia.inputChoice( u'\nWhat shall be done with this link?\n', ['unlink', 'skip', 'edit', 'more context', 'unlink all', 'quit'], ['U', 's', 'e', 'm', 'a', 'q'], 'u') wikipedia.output(u'')
def handleNextLink(self, text, match, context = 100): """ Returns a tuple (text, jumpToBeginning). text is the unicode string after the current link has been processed. jumpToBeginning is a boolean which specifies if the cursor position should be reset to 0. This is required after the user has edited the article. """ # ignore interwiki links and links to sections of the same page as well as section links if not match.group('title') or self.pageToUnlink.site().isInterwikiLink(match.group('title')) or match.group('section'): return text, False
333c7adbfe5dafc20ddb17800987a60848d63725 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4404/333c7adbfe5dafc20ddb17800987a60848d63725/unlink.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 2134, 2098, 12, 2890, 16, 977, 16, 845, 16, 819, 273, 2130, 4672, 3536, 2860, 279, 3193, 261, 955, 16, 11833, 774, 8149, 2093, 2934, 977, 353, 326, 5252, 533, 1839, 326, 783, 169...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 2134, 2098, 12, 2890, 16, 977, 16, 845, 16, 819, 273, 2130, 4672, 3536, 2860, 279, 3193, 261, 955, 16, 11833, 774, 8149, 2093, 2934, 977, 353, 326, 5252, 533, 1839, 326, 783, 169...
The base implementation uses sys.stdin.readline(); a subclass may replace this with a different implementation. """ sys.stdout.write(prompt) sys.stdout.flush() return sys.stdin.readline()
The base implementation uses the built-in function input(); a subclass may replace this with a different implementation. """ return input(prompt)
def raw_input(self, prompt=""): """Write a prompt and read a line.
5025c0f59033975e274b19b9110076dbc42d379b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12029/5025c0f59033975e274b19b9110076dbc42d379b/code.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1831, 67, 2630, 12, 2890, 16, 6866, 1546, 6, 4672, 3536, 3067, 279, 6866, 471, 855, 279, 980, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1831, 67, 2630, 12, 2890, 16, 6866, 1546, 6, 4672, 3536, 3067, 279, 6866, 471, 855, 279, 980, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
if hex(-16) != '0xfffffff0': raise TestFailed, 'hex(-16)'
if len(hex(-1)) != len(hex(sys.maxint)): raise TestFailed, 'len(hex(-1))' if hex(-16) not in ('0xfffffff0', '0xfffffffffffffff0'): raise TestFailed, 'hex(-16)'
def f(): pass
e4129c5fce2a68248977d0dcb50bd5da7b506e06 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/e4129c5fce2a68248977d0dcb50bd5da7b506e06/test_b1.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 13332, 1342, 225, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 284, 13332, 1342, 225, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
pickid = picking_obj.create(cr, uid, { 'name': pick_name, 'origin': str(picking.origin or ''), 'type': ptype, 'note': picking.note, 'move_type': picking.move_type, 'auto_picking': todo[0][1][1] == 'auto', 'stock_journal_id': todo[0][1][3], 'company_id': todo[0][1][4] or res_obj._company_default_get(cr, uid, 'stock.company', context), 'address_id': picking.address_id.id, 'invoice_state': 'none', 'date': picking.date, 'sale_id':' sale_id' in picking._columns.keys() and picking.sale_id.id or False })
check_picking_ids = picking_obj.search(cr, uid, [('name','=',picking.name),('origin','=',str(picking.origin or '')),('type','=',ptype),('move_type','=',picking.move_type)]) if check_picking_ids: pickid = check_picking_ids[0] else: if picking: pickid = picking_obj.create(cr, uid, { 'name': pick_name, 'origin': str(picking.origin or ''), 'type': ptype, 'note': picking.note, 'move_type': picking.move_type, 'auto_picking': todo[0][1][1] == 'auto', 'stock_journal_id': todo[0][1][3], 'company_id': todo[0][1][4] or res_obj._company_default_get(cr, uid, 'stock.company', context=context), 'address_id': picking.address_id.id, 'invoice_state': 'none', 'date': picking.date, 'sale_id':' sale_id' in picking._columns.keys() and picking.sale_id.id or False }) else: pickid = False
def create_chained_picking(self, cr, uid, moves, context=None): new_moves = [] res_obj = self.pool.get('res.company') picking_obj = self.pool.get('stock.picking') move_obj = self.pool.get('stock.move') if context is None: context = {} for picking, todo in self._chain_compute(cr, uid, moves, context=context).items(): ptype = todo[0][1][5] and todo[0][1][5] or self.pool.get('stock.location').picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0]) pick_name = picking.name if ptype == 'delivery': pick_name = self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.delivery')
22fb8bcb3d659320c8804bac2c9b2c034eb0db34 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/22fb8bcb3d659320c8804bac2c9b2c034eb0db34/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 67, 5639, 329, 67, 11503, 310, 12, 2890, 16, 4422, 16, 4555, 16, 13934, 16, 819, 33, 7036, 4672, 394, 67, 81, 10829, 273, 5378, 400, 67, 2603, 273, 365, 18, 6011, 18, 588, 2668,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5639, 329, 67, 11503, 310, 12, 2890, 16, 4422, 16, 4555, 16, 13934, 16, 819, 33, 7036, 4672, 394, 67, 81, 10829, 273, 5378, 400, 67, 2603, 273, 365, 18, 6011, 18, 588, 2668,...
self.parser.processStartTag(tagname, attributes) def processEndTag(self, tagname):
self.parser.processStartTag(name, attributes) def processEndTag(self, name):
def processStartTag(self, tagname, attributes): self.parser.switchPhase("rootElement") self.parser.processStartTag(tagname, attributes)
198b6bcf69be8b11872606e4a3148404ea57bed8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9368/198b6bcf69be8b11872606e4a3148404ea57bed8/parser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 30512, 12, 2890, 16, 25586, 16, 1677, 4672, 365, 18, 4288, 18, 9610, 11406, 2932, 3085, 1046, 7923, 365, 18, 4288, 18, 2567, 30512, 12, 2692, 529, 16, 1677, 13, 2, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 30512, 12, 2890, 16, 25586, 16, 1677, 4672, 365, 18, 4288, 18, 9610, 11406, 2932, 3085, 1046, 7923, 365, 18, 4288, 18, 2567, 30512, 12, 2692, 529, 16, 1677, 13, 2, -100, -100, -1...
try: chr(100000) except ValueError:
if sys.maxunicode == 65535:
def get_machine_details(): if _debug: print('Getting machine details...') buildno, builddate = platform.python_build() python = platform.python_version() try: chr(100000) except ValueError: # UCS2 build (standard) unitype = 'UCS2' else: # UCS4 build (most recent Linux distros) unitype = 'UCS4' bits, linkage = platform.architecture() return { 'platform': platform.platform(), 'processor': platform.processor(), 'executable': sys.executable, 'implementation': getattr(platform, 'python_implementation', lambda:'n/a')(), 'python': platform.python_version(), 'compiler': platform.python_compiler(), 'buildno': buildno, 'builddate': builddate, 'unicode': unitype, 'bits': bits, }
64c4d8f30f005a51fefb5a1e9022ffc45ea8f903 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/64c4d8f30f005a51fefb5a1e9022ffc45ea8f903/pybench.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 9149, 67, 6395, 13332, 225, 309, 389, 4148, 30, 1172, 2668, 19213, 5228, 3189, 7821, 13, 1361, 2135, 16, 25666, 330, 449, 340, 273, 4072, 18, 8103, 67, 3510, 1435, 5790, 273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 9149, 67, 6395, 13332, 225, 309, 389, 4148, 30, 1172, 2668, 19213, 5228, 3189, 7821, 13, 1361, 2135, 16, 25666, 330, 449, 340, 273, 4072, 18, 8103, 67, 3510, 1435, 5790, 273, ...
self.setMaxlag()
if self.maxlag == 5: self.setMaxlag()
def setSiteinfo(self): params = {'action':'query', 'meta':'siteinfo', 'siprop':'general|namespaces' } self.setMaxlag('60') req = api.APIRequest(self, params) info = req.query() self.setMaxlag() sidata = info['query']['general'] self.siteinfo = {} for item in sidata: self.siteinfo[item] = sidata[item] nsdata = info['query']['namespaces'] self.namespaces = {} for ns in nsdata: nsinfo = nsdata[ns] self.namespaces[nsinfo['id']] = nsinfo if not 'writeapi' in sidata: print "WARNING: Write-API not enabled, you will not be able to edit" version = re.search("\d\.(\d\d)", self.siteinfo['generator']) if not int(version.group(1)) >= 13: # Will this even work on 13? print "WARNING: Some features may not work on older versions of MediaWiki"
303b1fb30187f94bebd077256d4e1acde33dfb70 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10544/303b1fb30187f94bebd077256d4e1acde33dfb70/wiki.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 4956, 1376, 12, 2890, 4672, 859, 273, 13666, 1128, 11, 2497, 2271, 2187, 296, 3901, 11, 2497, 4256, 1376, 2187, 296, 28477, 1764, 11, 2497, 12259, 96, 16078, 11, 289, 365, 18, 542, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 444, 4956, 1376, 12, 2890, 4672, 859, 273, 13666, 1128, 11, 2497, 2271, 2187, 296, 3901, 11, 2497, 4256, 1376, 2187, 296, 28477, 1764, 11, 2497, 12259, 96, 16078, 11, 289, 365, 18, 542, ...
obj = REQUEST.resolve_url(url)
obj = self.resolve_url(self.getpath(rid), REQUEST)
def getobject(self, rid, REQUEST=None): """ Return a cataloged object given a 'data_record_id_' """ if REQUEST is None: REQUEST=self.REQUEST url='%s/%s' %(REQUEST.script, self.getpath(rid))
9b4f7bf919597f25b7a5ac3395eb72ac2415c82d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9658/9b4f7bf919597f25b7a5ac3395eb72ac2415c82d/ZCatalog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1612, 12, 2890, 16, 10911, 16, 12492, 33, 7036, 4672, 3536, 2000, 279, 6222, 329, 733, 864, 279, 296, 892, 67, 3366, 67, 350, 4623, 3536, 309, 12492, 353, 599, 30, 12492, 33, 2890...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1612, 12, 2890, 16, 10911, 16, 12492, 33, 7036, 4672, 3536, 2000, 279, 6222, 329, 733, 864, 279, 296, 892, 67, 3366, 67, 350, 4623, 3536, 309, 12492, 353, 599, 30, 12492, 33, 2890...
self.esp_window.assy.w.win_update() self.esp_window.assy.changed()
self.jig.assy.w.win_update() self.jig.assy.changed()
def accept(self): '''Slot for the 'OK' button ''' self.esp_window.cancelled = False text = QString(self.name_linedit.text()) text = text.stripWhiteSpace() # make sure name is not just whitespaces if text: self.esp_window.name = str(text) self.esp_window.width = float(self.width_spinbox.value()) self.esp_window.resolution = float(self.resolution_spinbox.value()) #self.glpane.assy.selwhat = self.sel_what self.esp_window.assy.w.win_update() # Update model tree self.esp_window.assy.changed() QDialog.accept(self)
520655b0839e9d192e34605d00ae60ec9bf13e2b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/520655b0839e9d192e34605d00ae60ec9bf13e2b/ESPWindowProp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2791, 12, 2890, 4672, 9163, 8764, 364, 326, 296, 3141, 11, 3568, 9163, 365, 18, 281, 84, 67, 5668, 18, 10996, 1259, 273, 1083, 225, 977, 273, 225, 2238, 780, 12, 2890, 18, 529, 67, 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, 2791, 12, 2890, 4672, 9163, 8764, 364, 326, 296, 3141, 11, 3568, 9163, 365, 18, 281, 84, 67, 5668, 18, 10996, 1259, 273, 1083, 225, 977, 273, 225, 2238, 780, 12, 2890, 18, 529, 67, 2...
output_base = 'namebench_%s' % datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d %H:%m')
output_base = 'namebench_%s' % datetime.datetime.strftime(datetime.datetime.now(), '%Y-%m-%d %H%m')
def benchmarkThread(self): pool = NSAutoreleasePool.alloc().init() self.spinner.startAnimation_(self) self.updateStatus('Preparing benchmark') self.nameservers.FindAndRemoveUndesirables() bmark = benchmark.Benchmark(self.nameservers, test_count=self.options.test_count, run_count=self.options.run_count, status_callback=self.updateStatus) bmark.CreateTestsFromFile('%s/data/alexa-top-10000-global.txt' % NB_SOURCE)
2efff298c0e3e5887eb2e75f30d510cdabf74f23 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4170/2efff298c0e3e5887eb2e75f30d510cdabf74f23/controller.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14128, 3830, 12, 2890, 4672, 2845, 273, 423, 5233, 322, 479, 2508, 2864, 18, 9853, 7675, 2738, 1435, 365, 18, 1752, 7872, 18, 1937, 10816, 67, 12, 2890, 13, 365, 18, 2725, 1482, 2668, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 14128, 3830, 12, 2890, 4672, 2845, 273, 423, 5233, 322, 479, 2508, 2864, 18, 9853, 7675, 2738, 1435, 365, 18, 1752, 7872, 18, 1937, 10816, 67, 12, 2890, 13, 365, 18, 2725, 1482, 2668, ...
n_blocks.y -= 1;
def c_code_reduce_100(self, sio, node, name, x, z, fail): makecall = self._makecall(node, name, x, z, fail) # use threadIdx.x for i0 # use blockIdx.x for i1 # use blockIdx.y for i2 print >> sio, """ { int verbose = 0; dim3 n_threads( std::min(CudaNdarray_HOST_DIMS(%(x)s)[0], NUM_VECTOR_OP_THREADS_PER_BLOCK)); dim3 n_blocks(CudaNdarray_HOST_DIMS(%(x)s)[1]); while (n_blocks.x * n_blocks.y <= NUM_VECTOR_OP_BLOCKS) { if (n_blocks.y > CudaNdarray_HOST_DIMS(%(x)s)[2]) break; n_blocks.y += 1; } n_blocks.y -= 1; %(makecall)s } """ %locals()
1ae40316454b97620f068bfff6aef9c6a154b467 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/1ae40316454b97620f068bfff6aef9c6a154b467/basic_ops.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 67, 710, 67, 12498, 67, 6625, 12, 2890, 16, 272, 1594, 16, 756, 16, 508, 16, 619, 16, 998, 16, 2321, 4672, 29796, 557, 454, 273, 365, 6315, 81, 581, 557, 454, 12, 2159, 16, 50...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 276, 67, 710, 67, 12498, 67, 6625, 12, 2890, 16, 272, 1594, 16, 756, 16, 508, 16, 619, 16, 998, 16, 2321, 4672, 29796, 557, 454, 273, 365, 6315, 81, 581, 557, 454, 12, 2159, 16, 50...
else
else:
def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 579) else quickfix.StringField.__init__(self, 579, 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, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1381, 7235, 13, 469, 30, 9549, 904, 18, 780, 974, 16186, 2738...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1381, 7235, 13, 469, 30, 9549, 904, 18, 780, 974, 16186, 2738...
if os.path.lexists(filename): yield filename
yield filename
def list_files(self): dirs = [ "~/.gimp-2.4/tmp", "~/.gimp-2.6/tmp"] for dirname in dirs: dirname = os.path.expanduser(dirname) for filename in children_in_directory(dirname, False): if os.path.lexists(filename): yield filename
7ba29f7966fa76b37a93eb1cac37d524bae0203e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7853/7ba29f7966fa76b37a93eb1cac37d524bae0203e/CleanerBackend.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 2354, 12, 2890, 4672, 7717, 273, 306, 19910, 15865, 75, 14532, 17, 22, 18, 24, 19, 5645, 3113, 19910, 15865, 75, 14532, 17, 22, 18, 26, 19, 5645, 11929, 364, 4283, 316, 7717, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 666, 67, 2354, 12, 2890, 4672, 7717, 273, 306, 19910, 15865, 75, 14532, 17, 22, 18, 24, 19, 5645, 3113, 19910, 15865, 75, 14532, 17, 22, 18, 26, 19, 5645, 11929, 364, 4283, 316, 7717, ...
winsound.Beep(37, 75) winsound.Beep(32767, 75)
if _have_soundcard(): winsound.Beep(37, 75) winsound.Beep(32767, 75) else: self.assertRaises(RuntimeError, winsound.Beep, 37, 75) self.assertRaises(RuntimeError, winsound.Beep, 32767, 75)
def test_extremes(self): winsound.Beep(37, 75) winsound.Beep(32767, 75)
2a426475c46371eb048b008205f9aa795faa9d32 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3187/2a426475c46371eb048b008205f9aa795faa9d32/test_winsound.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 408, 2764, 281, 12, 2890, 4672, 31307, 772, 18, 1919, 881, 12, 6418, 16, 18821, 13, 31307, 772, 18, 1919, 881, 12, 1578, 6669, 27, 16, 18821, 13, 2, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 408, 2764, 281, 12, 2890, 4672, 31307, 772, 18, 1919, 881, 12, 6418, 16, 18821, 13, 31307, 772, 18, 1919, 881, 12, 1578, 6669, 27, 16, 18821, 13, 2, -100, -100, -100, -100, ...
maxAllele=3, chromoName=["ch1", "ch2"],
maxAllele=3, chromNames=["ch1", "ch2"],
def testGenoStructure(self): 'Testing geno structure related functions' if AlleleType() != 'binary': pop = population(size=100, ploidy=2, loci=[5, 7], subPop=[20, 80], lociPos=[ [2,3,4,5,6],[2,4,6,8,10,12,14]], maxAllele=3, chromoName=["ch1", "ch2"], alleleNames=['A','C','T','G']) else: pop = population(size=100, ploidy=2, loci=[5, 7], subPop=[20, 80], lociPos=[ [2,3,4,5,6],[2,4,6,8,10,12,14]], chromoName=["ch1", "ch2"], alleleNames=['1','2']) # self.assertEqual(pop.ploidy(), 2) self.assertEqual(pop.ploidyName(), 'diploid') # self.assertEqual(pop.numChrom(), 2) self.assertEqual(pop.chromName(0), "ch1") self.assertEqual(pop.chromName(1), "ch2") # self.assertEqual(pop.numLoci(0), 5) self.assertEqual(pop.numLoci(1), 7) self.assertRaises(exceptions.IndexError, pop.numLoci, 2 ) # self.assertEqual(pop.locusPos(10), 12) self.assertRaises(exceptions.IndexError, pop.locusPos, 20 ) self.assertRaises((exceptions.TypeError, exceptions.OverflowError), pop.locusPos, -1 ) # more use of arr.. please see test_00_carray self.assertEqual(len(pop.arrLociPos()), 12) self.assertEqual(pop.arrLociPos().tolist(), [2,3,4,5,6,2,4,6,8,10,12,14]) # self.assertEqual(pop.chromBegin(0), 0) self.assertEqual(pop.chromBegin(1), 5) self.assertEqual(pop.chromEnd(0), 5) self.assertEqual(pop.chromEnd(1), 12) self.assertRaises(exceptions.IndexError, pop.chromBegin, 2 ) self.assertRaises(exceptions.IndexError, pop.chromEnd, 2 ) # self.assertEqual(pop.absLocusIndex(1,5), 10) self.assertEqual(pop.locusPos(pop.absLocusIndex(1,2) ), 6) self.assertRaises(exceptions.IndexError, pop.absLocusIndex, 2, 5 ) # self.assertEqual(pop.chromLocusPair(10), (1,5) ) self.assertRaises(exceptions.IndexError, pop.chromLocusPair, 50 ) # self.assertEqual(pop.totNumLoci(), 12) # self.assertEqual(pop.genoSize(), pop.totNumLoci()*pop.ploidy() ) # if AlleleType() == 'binary': self.assertEqual(pop.alleleNames(), ('1','2') ) self.assertEqual(pop.alleleName(0), '1') self.assertEqual(pop.alleleName(1), '2') # 5 is passed to be function as bool self.assertEqual(pop.alleleName(5), '2') else: self.assertEqual(pop.alleleName(0), 'A') self.assertEqual(pop.alleleName(1), 'C') self.assertEqual(pop.alleleName(2), 'T') self.assertEqual(pop.alleleName(3), 'G') self.assertRaises(exceptions.IndexError, pop.alleleName, 4) # loci name, default, the name will be used by other programs # or file format, so we set it to be one based. self.assertEqual(pop.locusName(0), 'loc1-1') self.assertEqual(pop.locusName(1), 'loc1-2') self.assertEqual(pop.locusName(5), 'loc2-1') pop = population(loci=[1,2], lociNames=['la','lb','lc']) self.assertEqual(pop.locusName(0), 'la') self.assertEqual(pop.locusName(1), 'lb') self.assertEqual(pop.locusName(2), 'lc') self.assertRaises(exceptions.IndexError, pop.locusName, 5)
ab23ac75769af805cbcf0cf7c54ac6d190a24bfc /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/401/ab23ac75769af805cbcf0cf7c54ac6d190a24bfc/test_02_population.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 43, 5764, 6999, 12, 2890, 4672, 296, 22218, 3157, 83, 3695, 3746, 4186, 11, 309, 4826, 6516, 559, 1435, 480, 296, 8578, 4278, 1843, 273, 11209, 12, 1467, 33, 6625, 16, 293, 383, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 43, 5764, 6999, 12, 2890, 4672, 296, 22218, 3157, 83, 3695, 3746, 4186, 11, 309, 4826, 6516, 559, 1435, 480, 296, 8578, 4278, 1843, 273, 11209, 12, 1467, 33, 6625, 16, 293, 383, ...
valueParent.GetSize().x+IECWidthFudge) self.expander = None if self.propEditor: self.propValue = self.propEditor.getValue() displayVal = self.propEditor.getDisplayValue() if self.propEditor.getStyle().count(PropertyEditors.esExpandable): mID = NewId() self.expander = wxCheckBox(nameParent, mID, '', wxPoint(8 * self.indent, self.idx * oiLineHeight +2), wxSize(12, 14)) self.expander.SetValue(true) EVT_CHECKBOX(self.expander, mID, self.OnExpand) else: self.propValue = '' displayVal = ''
valueParent.GetSize().x + IECWidthFudge) self.expander = None if self.propEditor: self.propEditor.ownerPropEdit = ownerPropEdit self.updatePropValue() displayVal = self.propEditor.getDisplayValue() if PropertyEditors.esExpandable in self.propEditor.getStyle(): mID = NewId() self.expander = wxCheckBox(nameParent, mID, '', wxPoint(8 * self.indent, self.idx * oiLineHeight +2), wxSize(12, 14)) self.expander.SetValue(true) EVT_CHECKBOX(self.expander, mID, self.OnExpand) else: self.propValue = '' displayVal = ''
def __init__(self, inspector, nameParent, valueParent, companion, rootCompanion, name, propWrapper, idx, indent, editor = None, options = None, names = None):
746f53548fb8bb54a235b1bfa31a4bdb769818e8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4325/746f53548fb8bb54a235b1bfa31a4bdb769818e8/Inspector.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 22700, 16, 508, 3054, 16, 460, 3054, 16, 1161, 304, 285, 16, 1365, 2945, 304, 285, 16, 508, 16, 2270, 3611, 16, 2067, 16, 3504, 16, 4858, 273, 599, 16,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 22700, 16, 508, 3054, 16, 460, 3054, 16, 1161, 304, 285, 16, 1365, 2945, 304, 285, 16, 508, 16, 2270, 3611, 16, 2067, 16, 3504, 16, 4858, 273, 599, 16,...
return markdown.markdown(self.content)
return markdown(self.content)
def html(self): return markdown.markdown(self.content)
857cc4b181ee858ddba0f40ebbfe3f8f22448c31 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12041/857cc4b181ee858ddba0f40ebbfe3f8f22448c31/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1729, 12, 2890, 4672, 327, 12737, 18, 20090, 12, 2890, 18, 1745, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 1729, 12, 2890, 4672, 327, 12737, 18, 20090, 12, 2890, 18, 1745, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
text, doc = 1, ''.join(traceback.format_exception(*info))
doc = ''.join(traceback.format_exception(*info)) plain = True
def handle(self, info=None): info = info or sys.exc_info() self.file.write(reset())
364ca40c2a053718f67c2032769de1f1fd76bb22 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/364ca40c2a053718f67c2032769de1f1fd76bb22/cgitb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 16, 1123, 33, 7036, 4672, 1123, 273, 1123, 578, 2589, 18, 10075, 67, 1376, 1435, 365, 18, 768, 18, 2626, 12, 6208, 10756, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1640, 12, 2890, 16, 1123, 33, 7036, 4672, 1123, 273, 1123, 578, 2589, 18, 10075, 67, 1376, 1435, 365, 18, 768, 18, 2626, 12, 6208, 10756, 2, -100, -100, -100, -100, -100, -100, -100, -...
qmname = '.'.join(SplitAll(path))
qmname = '.'.join(map(lambda p: QMSanitize(p), SplitAll(path)))
def DoQMTestDir(path, control): """Create a QMTest directory for a given path. The provided directory must have a 'benchmark.xml' file. This creates the corresponding QMTest directories, and copies files from the original directory to the test directories. 'path' -- Path to the benchmark in the source tree. 'control' -- Results of parsing the regtest control file, as returned from 'ReadControlFile()'. { 'testroots': testroots, 'targets': targets, 'whichtypes' : whichtypes } where testroots is a list of directories to search in BuildQMTestTree targets is list of backend, option pairs for use with StreamIt compiler, and whichtypes is a list of benchmark 'types' to execute.""" benchmarkname = os.path.join(path, 'benchmark.xml') qmname = '.'.join(SplitAll(path)) qmdir = DirToQMDir(path) dom = xml.dom.minidom.parse(benchmarkname) # We basically want to ignore the entire benchmark.xml file, except # for the <implementations>. implementationss = dom.getElementsByTagName('implementations') implementations = implementationss[0] impls = implementations.getElementsByTagName('impl') # Only StreamIt implementations are interesting. impls = filter(lambda i: i.getAttribute('lang') == 'StreamIt', impls) seq = 0 whichtypes = control['whichtypes'] for impl in impls: # If benchmark has regtest="skip" field, skip it if (impl.getAttribute('regtest') == 'skip'): continue # if regtest is looking for markers for a certain subset of benchmarks # and if this benchmark has 'whichtype' markers, and there is no # intersection between the sought markers and the markers on this # benchmark, then skip this benchmark. if (len(whichtypes) > 0): twhichtypes = [] testtypes = impl.getElementsByTagName('whichtype') for node in testtypes: tnode = node.firstChild # ASSERT: tnode is a text node if (tnode and tnode.data != ''): twhichtypes.append(tnode.data) twhichtypes.sort() if (len(twhichtypes > 0) and EmptyIntersectionOfSorted(whichtypes, twhichtypes)): continue # Where are the source files? If the implementation has # a dir attribute, they're in that subdirectory. srcdir = path subdir = impl.getAttribute('dir') if subdir: srcdir = os.path.join(srcdir, subdir) # What is the name of this implementation? Number them # sequentially, but override if the implementation has an # id attribute. Don't use a separate name if there's only # one implementation. if len(impls) == 1: benchname = qmname benchdir = qmdir else: seq = seq + 1 id = impl.getAttribute('id') if not id: id = "impl%d" % seq benchname = qmname + "." + id benchdir = os.path.join(qmdir, id + ".qms") # Create the benchmark directory. if not os.path.exists(benchdir): os.makedirs(benchdir) # Run appropriate Makefile if any makes=impl.getElementsByTagName('make') for make in makes: mnode=make.firstChild mn=mnode.data run=os.popen("cd "+srcdir+";make -f "+mn,'r') run.close() # Walk through the files. Classify them by their class # attribute, and also copy them into benchdir. fileset = {} files = impl.getElementsByTagName('file') for file in files: fnode = file.firstChild fn = fnode.data cls = file.getAttribute('class') if not cls: cls = 'source' if cls not in fileset: fileset[cls] = [] fileset[cls].append(fn) ActuallyBuildTests(srcdir, benchdir, fileset, benchname, control) dom.unlink()
af50bbb30354adfa8b4fcc913dd11d9a0964af81 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8781/af50bbb30354adfa8b4fcc913dd11d9a0964af81/build-qmtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2256, 53, 49, 4709, 1621, 12, 803, 16, 3325, 4672, 3536, 1684, 279, 2238, 49, 4709, 1867, 364, 279, 864, 589, 18, 225, 1021, 2112, 1867, 1297, 1240, 279, 296, 70, 9737, 18, 2902, 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, 2256, 53, 49, 4709, 1621, 12, 803, 16, 3325, 4672, 3536, 1684, 279, 2238, 49, 4709, 1867, 364, 279, 864, 589, 18, 225, 1021, 2112, 1867, 1297, 1240, 279, 296, 70, 9737, 18, 2902, 11, ...
def getProcessParamsFromCache(self, subCache, time):
def getProcessParamsFromCache(self, subCache, tag, time):
def getProcessParamsFromCache(self, subCache, time): process = self.ifoDict() for ifo in subCache: for f in subCache[ifo]: doc = utils.load_filename(f.path(),None) proc = table.get_table(doc, lsctables.ProcessParamsTable.tableName) for row in proc: if str(row.param).find("--trig-start-time") > 0: start = eval(row.value) else: if str(row.param).find("--gps-start-time") >= 0: start = eval(row.value) if str(row.param).find("--trig-end-time") > 0: end = eval(row.value) else: if str(row.param).find("--gps-end-time") >= 0: end = eval(row.value) try: if ( (end >= time[ifo]) and (start <= time[ifo]) ): process[ifo] = proc break except: pass return process
15a5d653627dd6482d1cbe9c5cdf866130717e3a /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/5758/15a5d653627dd6482d1cbe9c5cdf866130717e3a/fu_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18758, 1370, 19800, 12, 2890, 16, 720, 1649, 16, 1047, 16, 813, 4672, 1207, 273, 365, 18, 20299, 5014, 1435, 364, 21479, 316, 720, 1649, 30, 364, 284, 316, 720, 1649, 63, 20299, 14542, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 18758, 1370, 19800, 12, 2890, 16, 720, 1649, 16, 1047, 16, 813, 4672, 1207, 273, 365, 18, 20299, 5014, 1435, 364, 21479, 316, 720, 1649, 30, 364, 284, 316, 720, 1649, 63, 20299, 14542, ...
raise argparse.ArgumentError("-d destdir require exactly one " "directory argument")
raise argparse.ArgumentError( "-d destdir requires exactly one directory argument")
def main(): """Script main program.""" import argparse parser = argparse.ArgumentParser( description='Utilities to support installing Python libraries.') parser.add_argument('-l', action='store_const', default=10, const=0, dest='maxlevels', help="don't recurse down") parser.add_argument('-f', action='store_true', dest='force', help='force rebuild even if timestamps are up to date') parser.add_argument('-q', action='store_true', dest='quiet', help='quiet operation') parser.add_argument('-b', action='store_true', dest='legacy', help='procude legacy byte-compiled file paths') parser.add_argument('-d', metavar='DESTDIR', dest='ddir', default=None, help=('purported directory name for error messages; ' 'if no directory arguments, -l sys.path ' 'is assumed.')) parser.add_argument('-x', metavar='REGEXP', dest='rx', default=None, help=('skip files matching the regular expression.\n\t' 'The regexp is searched for in the full path' 'of the file')) parser.add_argument('-i', metavar='FILE', dest='flist', help='expand the list with the contenent of FILE.') parser.add_argument('compile_dest', metavar='FILE|DIR', nargs='?') args = parser.parse_args() if (args.ddir and args.compile_dest != 1 and not os.path.isdir(args.compile_dest)): raise argparse.ArgumentError("-d destdir require exactly one " "directory argument") if args.rx: import re args.rx = re.compile(args.rx) # if flist is provided then load it compile_dests = [args.compile_dest] if args.flist: with open(args.flist) as f: files = f.read().split() compile_dests.extend(files) try: if compile_dests: for dest in compile_dests: if os.path.isdir(dest): if not compile_dir(dest, args.maxlevels, args.ddir, args.force, args.rx, args.quiet, args.legacy): return 0 else: if not compile_file(dest, args.ddir, args.force, args.rx, args.quiet, args.legacy): return 0 else: return compile_path(legacy=args.legacy) except KeyboardInterrupt: print("\n[interrupt]") return 0 return 1
28e6de34044fbb5fd0a9533a308170577b018bd3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8125/28e6de34044fbb5fd0a9533a308170577b018bd3/compileall.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 3536, 3651, 2774, 5402, 12123, 1930, 12436, 225, 2082, 273, 12436, 18, 1379, 2678, 12, 2477, 2218, 11864, 358, 2865, 3799, 310, 6600, 14732, 1093, 13, 2082, 18, 1289, 67, 3446...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 3651, 2774, 5402, 12123, 1930, 12436, 225, 2082, 273, 12436, 18, 1379, 2678, 12, 2477, 2218, 11864, 358, 2865, 3799, 310, 6600, 14732, 1093, 13, 2082, 18, 1289, 67, 3446...
"""Capable of both signing and verifying. This outputs standard signatures
"""Capable of both signing and verifying. This outputs standard signatures
def Sign(self, data): """ Sign given data and return corresponding signature. For message M, outputs the signature as Header|Sig(Header.M). @param data: message to be signed @type data: string @return: signature on the data encoded as a Base64 string @rtype: string """ signing_key = self.primary_key if signing_key is None: raise errors.NoPrimaryKeyError() header = signing_key.Header() return util.Encode(header + signing_key.Sign(data + VERSION_BYTE))
2ea8447951163e6a62b115b5c1068033e2eb4f4a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12014/2ea8447951163e6a62b115b5c1068033e2eb4f4a/keyczar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4383, 12, 2890, 16, 501, 4672, 3536, 4383, 864, 501, 471, 327, 4656, 3372, 18, 225, 2457, 883, 490, 16, 6729, 326, 3372, 487, 4304, 96, 8267, 12, 1864, 18, 49, 2934, 225, 632, 891, 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, 4383, 12, 2890, 16, 501, 4672, 3536, 4383, 864, 501, 471, 327, 4656, 3372, 18, 225, 2457, 883, 490, 16, 6729, 326, 3372, 487, 4304, 96, 8267, 12, 1864, 18, 49, 2934, 225, 632, 891, 5...
if not raw and code[q-1] == '\\':
if code[q-1] == '\\':
def strip_string_literals(code, state=None): r""" Returns a string with all literal quotes replaced with labels and a dict of labels for re-subsitution. This makes parsing much easier. EXAMPLES: sage: from sage.misc.preparser import strip_string_literals sage: s, literals, state = strip_string_literals(r'''['a', "b", 'c', "d\""]''') sage: s '[%(L1)s, %(L2)s, %(L3)s, %(L4)s]' sage: literals {'L4': '"d\\""', 'L2': '"b"', 'L3': "'c'", 'L1': "'a'"} sage: print s % literals ['a', "b", 'c', "d\""] sage: print strip_string_literals(r'-"\\\""-"\\"-')[0] -%(L1)s-%(L2)s- Triple-quotes are handled as well. sage: s, literals, state = strip_string_literals("[a, '''b''', c, '']") sage: s '[a, %(L1)s, c, %(L2)s]' sage: print s % literals [a, '''b''', c, ''] Comments are subsituted too: sage: s, literals, state = strip_string_literals("code '#' # ccc 't'"); s 'code %(L1)s #%(L2)s' sage: s % literals "code '#' # ccc 't'" A state is returned so one can break strings across multiple calls to this function: sage: s, literals, state = strip_string_literals('s = "some'); s 's = %(L1)s' sage: s, literals, state = strip_string_literals('thing" * 5', state); s '%(L1)s * 5' """ new_code = [] literals = {} counter = 0 start = q = 0 if state is None: in_quote = False raw = False else: in_quote, raw = state while True: sig_q = code.find("'", q) dbl_q = code.find('"', q) hash_q = code.find('#', q) q = min(sig_q, dbl_q) if q == -1: q = max(sig_q, dbl_q) if not in_quote and hash_q != -1 and (q == -1 or hash_q < q): # it's a comment newline = code.find('\n', hash_q) if newline == -1: newline = len(code) counter += 1 label = "L%s" % counter literals[label] = code[hash_q+1:newline] new_code.append(code[start:hash_q].replace('%','%%')) new_code.append("#%%(%s)s" % label) start = q = newline elif q == -1: if in_quote: counter += 1 label = "L%s" % counter literals[label] = code[start:] new_code.append("%%(%s)s" % label) else: new_code.append(code[start:].replace('%','%%')) break elif in_quote: if not raw and code[q-1] == '\\': k = 2 while code[q-k] == '\\': k += 1 if k % 2 == 0: q += 1 if code[q:q+len(in_quote)] == in_quote: counter += 1 label = "L%s" % counter literals[label] = code[start:q+len(in_quote)] new_code.append("%%(%s)s" % label) q += len(in_quote) start = q in_quote = False else: q += 1 else: raw = q>0 and code[q-1] in 'rR' if len(code) >= q+3 and (code[q+1] == code[q] == code[q+2]): in_quote = code[q]*3 else: in_quote = code[q] new_code.append(code[start:q].replace('%', '%%')) start = q q += len(in_quote) return "".join(new_code), literals, (in_quote, raw)
5a2c96c32563a398062508fd709c7a214197b32d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/5a2c96c32563a398062508fd709c7a214197b32d/preparser.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2569, 67, 1080, 67, 80, 11235, 12, 710, 16, 919, 33, 7036, 4672, 436, 8395, 2860, 279, 533, 598, 777, 7158, 10681, 8089, 598, 3249, 471, 279, 2065, 434, 3249, 364, 283, 17, 22284, 305,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2569, 67, 1080, 67, 80, 11235, 12, 710, 16, 919, 33, 7036, 4672, 436, 8395, 2860, 279, 533, 598, 777, 7158, 10681, 8089, 598, 3249, 471, 279, 2065, 434, 3249, 364, 283, 17, 22284, 305,...
if not any([audio_rtp, msrp_chat]): raise ValueError("None of the streams proposed by the remote party is accepted")
if not any([audio_rtp, msrp_chat]): raise ValueError("None of the streams proposed by the remote party is accepted")
def accept_proposal(self, audio=False, chat=False): """Accept a proposal of stream(s) being added. Moves the object from the PROPOSED state to the ESTABLISHED state.""" with self._lock: if self.state != "PROPOSED": raise SessionStateError("This method can only be called while in the PROPOSED state") remote_sdp = self._inv.get_offered_remote_sdp() audio_rtp = None msrp_chat = None for media in remote_sdp.media: if audio and self.audio_transport is None and media.media == "audio" and media.port != 0 and audio_rtp is None: audio_rtp = AccountRTPTransport(self.account, self._inv.transport) elif chat and self.chat_transport is None and media.media == "message" and media.port != 0 and msrp_chat is None: msrp_chat = MSRPChat(self.account, self._inv.remote_uri, False) if not any([audio_rtp, msrp_chat]): raise ValueError("None of the streams proposed by the remote party is accepted") media_initializer = MediaTransportInitializer(self._accept_proposal_continue, self._accept_proposal_fail, audio_rtp, msrp_chat) self.chat_transport = msrp_chat
413e8e2d484a582dfed71113ff49d343cd148daa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3449/413e8e2d484a582dfed71113ff49d343cd148daa/session.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2791, 67, 685, 8016, 12, 2890, 16, 7447, 33, 8381, 16, 7916, 33, 8381, 4672, 3536, 5933, 279, 14708, 434, 1407, 12, 87, 13, 3832, 3096, 18, 490, 10829, 326, 733, 628, 326, 4629, 2419, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2791, 67, 685, 8016, 12, 2890, 16, 7447, 33, 8381, 16, 7916, 33, 8381, 4672, 3536, 5933, 279, 14708, 434, 1407, 12, 87, 13, 3832, 3096, 18, 490, 10829, 326, 733, 628, 326, 4629, 2419, ...
@needs_radix_and_thousands
def test_lc_numeric_nl_langinfo(self): # Test nl_langinfo against known values for loc in candidate_locales: try: setlocale(LC_NUMERIC, loc) setlocale(LC_CTYPE, loc) except Error: continue for li, lc in ((_locale.RADIXCHAR, "decimal_point"), (_locale.THOUSEP, "thousands_sep")): self.numeric_tester('nl_langinfo', nl_langinfo(li), lc, loc)
af7d345fb06e6621a9cf37afe65a93daf928046c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/af7d345fb06e6621a9cf37afe65a93daf928046c/test__locale.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 17704, 67, 5246, 67, 14039, 67, 4936, 1376, 12, 2890, 4672, 468, 7766, 7741, 67, 4936, 1376, 5314, 4846, 924, 364, 1515, 316, 5500, 67, 22638, 30, 775, 30, 444, 6339, 12, 133...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 17704, 67, 5246, 67, 14039, 67, 4936, 1376, 12, 2890, 4672, 468, 7766, 7741, 67, 4936, 1376, 5314, 4846, 924, 364, 1515, 316, 5500, 67, 22638, 30, 775, 30, 444, 6339, 12, 133...
raise self.ReferenceTimeParseError('variable "%s" lacks "units" attribute.' % (dimname,)) fullunit = cdfvar.units if ' since ' not in fullunit: raise self.ReferenceTimeParseError('"units" attribute of variable "%s" equals "%s", which does not follow COARDS convention. Problem: string does not contain " since ".' % (dimname,fullunit)) timeunit,reftime = fullunit.split(' since ') datematch = re.match(r'(\d\d\d\d)[-\/](\d{1,2})-(\d{1,2})\s*',reftime) if datematch is None: raise self.ReferenceTimeParseError('"units" attribute of variable "time" equals "%s", which does not follow COARDS convention. Problem: cannot parse date in "%s".' % (fullunit,reftime)) year,month,day = map(int,datematch.group(1,2,3)) year = max(year,1900) hours,minutes,seconds,mseconds = 0,0,0,0 reftime = reftime[datematch.end():] if len(reftime)>0: timematch = re.match(r'(\d{1,2}):(\d{1,2}):(\d{1,2}(?:\.\d*)?)\s*',reftime) if timematch is None: raise self.ReferenceTimeParseError('"units" attribute of variable "time" equals "%s", which does not follow COARDS convention. Problem: cannot parse time in "%s".' % (fullunit,reftime)) hours,minutes = map(int,timematch.group(1,2)) seconds = float(timematch.group(3)) mseconds = 1e6*(seconds % 1.) seconds = int(seconds) reftime = reftime[timematch.end():] dateref = datetime.datetime(year,month,day,hours,minutes,seconds,tzinfo=xmlstore.util.utc) if len(reftime)>0: timezonematch = re.match(r'(-?\d{1,2})(?::?(\d\d))?$',reftime) if timezonematch is None: raise self.ReferenceTimeParseError('"units" attribute of variable "time" equals "%s", which does not follow COARDS convention. Problem: cannot parse time zone in "%s".' % (fullunit,reftime)) if timezonematch.group(2) is None: dhour,dmin = int(timezonematch.group(1)),0 else: dhour,dmin = map(int,timezonematch.group(1,2)) if dhour<0: dmin = -dmin dateref -= datetime.timedelta(hours=dhour,minutes=dmin) timeunit = timeunit.lower() if timeunit in ('seconds','second','secs','sec','ss','s'): timeunit = 1./86400. elif timeunit in ('minutes','minute','mins','min'): timeunit = 1./1440. elif timeunit in ('hours','hour','hrs','hr','hs','h'): timeunit = 1./24. elif timeunit in ('days','day','ds','d'): timeunit = 1. elif timeunit in ('years','year','yrs','yr','ys','y'): timeunit = 365. else: raise self.ReferenceTimeParseError('"units" attribute of variable "time" equals "%s", which does not follow COARDS convention. Problem: unknown time unit "%s".' % (fullunit,timeunit)) return timeunit,dateref
raise ReferenceTimeParseError('variable "%s" lacks "units" attribute.' % (dimname,)) return parseNcTimeUnit(cdfvar.units)
def getTimeReference(self,dimname): """Parses the "units" attribute of the NetCDF variable, and returns the time unit (in days) and the reference date. Throws an exception if the "units" attribute does not match the COARDS/udunits convention for specifying time offsets. Supposedly the udunits package could do this, but so far I have not found a minimal udunits module for Python. """ nc = self.getcdf() if dimname not in nc.variables: raise self.ReferenceTimeParseError('dimensions "%s" does not have an associated variable.' % (dimname,))
d595d0017e779a5b06214ee30e710e5635deab41 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/381/d595d0017e779a5b06214ee30e710e5635deab41/data.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6135, 2404, 12, 2890, 16, 3509, 529, 4672, 3536, 6656, 326, 315, 7705, 6, 1566, 434, 326, 8503, 39, 4577, 2190, 16, 471, 1135, 326, 813, 2836, 261, 267, 4681, 13, 471, 326, 2114, 1509,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6135, 2404, 12, 2890, 16, 3509, 529, 4672, 3536, 6656, 326, 315, 7705, 6, 1566, 434, 326, 8503, 39, 4577, 2190, 16, 471, 1135, 326, 813, 2836, 261, 267, 4681, 13, 471, 326, 2114, 1509,...
def name_get(self, cr, uid, ids, context={}):
def name_get(self, cr, uid, ids, context=None):
def name_get(self, cr, uid, ids, context={}): if not len(ids): return [] reads = self.read(cr, uid, ids, ['name','parent_id'], context) res = [] for record in reads: name = record['name'] if record['parent_id']: name = record['parent_id'][1]+' / '+name res.append((record['id'], name)) return res
bc3451b40253f5e7812cd78fb3b115bdc4804319 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/bc3451b40253f5e7812cd78fb3b115bdc4804319/product.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 508, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 309, 486, 562, 12, 2232, 4672, 327, 5378, 6838, 273, 365, 18, 896, 12, 3353, 16, 4555, 16, 3258, 16, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 508, 67, 588, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 819, 33, 7036, 4672, 309, 486, 562, 12, 2232, 4672, 327, 5378, 6838, 273, 365, 18, 896, 12, 3353, 16, 4555, 16, 3258, 16, ...
secure = notebook.secure
def render(self, request): if request.args.has_key('email'): if request.args['email'][0] is not None : global notebook, waiting user = request.args['username'][0] passwd = request.args['password'][0] destaddr = """%s""" % request.args['email'][0] from sage.server.notebook.smtpsend import send_mail from sage.server.notebook.register import make_key, build_msg # TODO: make this come from the server settings key = make_key() listenaddr = notebook.address port = notebook.port secure = notebook.secure fromaddr = 'no-reply@%s' % listenaddr body = build_msg(key, user, listenaddr, port, secure) send_mail(self, fromaddr, destaddr, "SAGE Notebook Registration",body) waiting[key] = user # now say that the user has been registered. s = """\
dfd2ccbcd8e060bcacdbe83b7a24432fcfe1e133 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/dfd2ccbcd8e060bcacdbe83b7a24432fcfe1e133/twist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 590, 4672, 309, 590, 18, 1968, 18, 5332, 67, 856, 2668, 3652, 11, 4672, 309, 590, 18, 1968, 3292, 3652, 3546, 63, 20, 65, 353, 486, 599, 294, 2552, 14718, 16, 733...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 12, 2890, 16, 590, 4672, 309, 590, 18, 1968, 18, 5332, 67, 856, 2668, 3652, 11, 4672, 309, 590, 18, 1968, 3292, 3652, 3546, 63, 20, 65, 353, 486, 599, 294, 2552, 14718, 16, 733...
class DBShelf(MutableMapping):
class DBShelf(DictMixin):
def open(filename, flags=db.DB_CREATE, mode=0660, filetype=db.DB_HASH, dbenv=None, dbname=None): """ A simple factory function for compatibility with the standard shleve.py module. It can be used like this, where key is a string and data is a pickleable object: from bsddb import dbshelve db = dbshelve.open(filename) db[key] = data db.close() """ if type(flags) == type(''): sflag = flags if sflag == 'r': flags = db.DB_RDONLY elif sflag == 'rw': flags = 0 elif sflag == 'w': flags = db.DB_CREATE elif sflag == 'c': flags = db.DB_CREATE elif sflag == 'n': flags = db.DB_TRUNCATE | db.DB_CREATE else: raise db.DBError, "flags should be one of 'r', 'w', 'c' or 'n' or use the bsddb.db.DB_* flags" d = DBShelf(dbenv) d.open(filename, dbname, filetype, flags, mode) return d
f88eed430481f8f1436411f1db37808e5a6e298a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/f88eed430481f8f1436411f1db37808e5a6e298a/dbshelve.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 12, 3459, 16, 2943, 33, 1966, 18, 2290, 67, 9344, 16, 1965, 33, 7677, 4848, 16, 18902, 33, 1966, 18, 2290, 67, 15920, 16, 1319, 3074, 33, 7036, 16, 18448, 33, 7036, 4672, 3536, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 12, 3459, 16, 2943, 33, 1966, 18, 2290, 67, 9344, 16, 1965, 33, 7677, 4848, 16, 18902, 33, 1966, 18, 2290, 67, 15920, 16, 1319, 3074, 33, 7036, 16, 18448, 33, 7036, 4672, 3536, ...
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
def GetCurrentBitrate(self, iwconfig=None): """ Get the current bitrate for the interface. """ if not self.iface: return "" data = (self.iface + '\0' * 32)[:32] s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) fmt = "ihbb" size = struct.calcsize(fmt) try: data = fcntl.ioctl(s, 0x8B21, ifreq)[16:]  # 0x8B21 is SIOCGIWRATE in /usr/include/linux/wireless.h except IOError, e: if self.verbose: print "SIOCGIWAP failed: " + str(e) return "" f, e, x, x = struct.unpack(fmt, data[:size])
1e65babbd91a128171b8b012ccfd017dab3b717f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12280/1e65babbd91a128171b8b012ccfd017dab3b717f/be-ioctl.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 3935, 5775, 5141, 12, 2890, 16, 25522, 1425, 33, 7036, 4672, 3536, 968, 326, 783, 2831, 5141, 364, 326, 1560, 18, 3536, 309, 486, 365, 18, 31479, 30, 327, 1408, 501, 273, 261, 289...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 968, 3935, 5775, 5141, 12, 2890, 16, 25522, 1425, 33, 7036, 4672, 3536, 968, 326, 783, 2831, 5141, 364, 326, 1560, 18, 3536, 309, 486, 365, 18, 31479, 30, 327, 1408, 501, 273, 261, 289...
computed = getattr(hashlib, name)(data).hexdigest() self.assertEqual(computed, digest) computed = hashlib.new(name, data).hexdigest() self.assertEqual(computed, digest)
constructors = self.constructors_to_test[name] self.assertGreaterEqual(len(constructors), 2) for hash_object_constructor in constructors: computed = hash_object_constructor(data).hexdigest() self.assertEqual( computed, digest, "Hash algorithm %s constructed using %s returned hexdigest" " %r for %d byte input data that should have hashed to %r." % (name, hash_object_constructor, computed, len(data), digest))
def check(self, name, data, digest): # test the direct constructors computed = getattr(hashlib, name)(data).hexdigest() self.assertEqual(computed, digest) # test the general new() interface computed = hashlib.new(name, data).hexdigest() self.assertEqual(computed, digest)
6dcdcde2a889ce6937c9c42552c665067fe0dde2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8546/6dcdcde2a889ce6937c9c42552c665067fe0dde2/test_hashlib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 2890, 16, 508, 16, 501, 16, 5403, 4672, 468, 1842, 326, 2657, 19874, 8470, 273, 3869, 12, 2816, 2941, 16, 508, 21433, 892, 2934, 7118, 10171, 1435, 365, 18, 11231, 5812, 12, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 2890, 16, 508, 16, 501, 16, 5403, 4672, 468, 1842, 326, 2657, 19874, 8470, 273, 3869, 12, 2816, 2941, 16, 508, 21433, 892, 2934, 7118, 10171, 1435, 365, 18, 11231, 5812, 12, 2...
assert isinstance(m, Chunk)
if self._is_dnaGroup_highlighting_enabled(): dnaGroup = a_chunk.getDnaGroup() if dnaGroup is not None: m = dnaGroup
def chunkLeftUp(self, a_chunk, event): """ Depending on the modifier key(s) pressed, it does various operations on chunk. Example: if Shift and Control modkeys are pressed, it deletes the chunk @param a_chunk: The chunk of the object clicked (example, if the object is an atom, then it is atom.molecule @type a_chunk: B{Chunk} @param event: MouseLeftUp event @see: self.atomLeftUp @see: self.chunkLeftDown """ #Note: The following check is already done in #selectMode.doObjectspecificLeftUp. #self.chunkLeftUp method should never be called if #self.current_obj_clicked is False. The check below is added just #to be on a safer side and prints a warning. if not self.current_obj_clicked: print_compact_stack("Note: self.current_obj_clicked is False " "and still selectMolsMode.chunkLeftUp is called. Make sure to " "call selectMode.objectSpecificLeftUp before calling " "selectMolsMode.chunkLeftUp: ") return m = a_chunk assert isinstance(m, Chunk) if self.o.modkeys is None: self.o.assy.unpickall_in_GLPane() m.pick() elif self.o.modkeys == 'Shift+Control': obj = self.get_obj_under_cursor(event) if obj is self.o.selobj: m.kill() self.o.selobj = None self.w.win_update()
085acfcfc4cd51a3d1b9b6f08626917e0ffda345 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11221/085acfcfc4cd51a3d1b9b6f08626917e0ffda345/SelectChunks_GraphicsMode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2441, 3910, 1211, 12, 2890, 16, 279, 67, 6551, 16, 871, 4672, 3536, 4019, 2846, 603, 326, 9606, 498, 12, 87, 13, 19504, 16, 518, 1552, 11191, 5295, 603, 2441, 18, 5090, 30, 309, 21444,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2441, 3910, 1211, 12, 2890, 16, 279, 67, 6551, 16, 871, 4672, 3536, 4019, 2846, 603, 326, 9606, 498, 12, 87, 13, 19504, 16, 518, 1552, 11191, 5295, 603, 2441, 18, 5090, 30, 309, 21444,...
if f.endswith('.xpi'): CopyFileToDir(f, upload_dir, latestPath)
CopyFileToDir(f, upload_dir, latestPath)
def ReleaseToLatest(options, upload_dir, files): latestDir = LATEST_DIR % {'branch': options.branch} latestPath = os.path.join(NIGHTLY_PATH, latestDir) for f in files: if f.endswith('.xpi'): CopyFileToDir(f, upload_dir, latestPath)
97fb1f2d7477cac8988db8e0a2684a5156cba74b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6206/97fb1f2d7477cac8988db8e0a2684a5156cba74b/post_upload.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 10819, 774, 18650, 12, 2116, 16, 3617, 67, 1214, 16, 1390, 4672, 4891, 1621, 273, 511, 1777, 882, 67, 4537, 738, 13666, 7500, 4278, 702, 18, 7500, 97, 4891, 743, 273, 1140, 18, 803, 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, 10819, 774, 18650, 12, 2116, 16, 3617, 67, 1214, 16, 1390, 4672, 4891, 1621, 273, 511, 1777, 882, 67, 4537, 738, 13666, 7500, 4278, 702, 18, 7500, 97, 4891, 743, 273, 1140, 18, 803, 18...
cmd += self.autConf['autPath' + aut]
autPathList = self.autConf['autPath' + aut].split("?") if len(autPathList) == 1: cmd += autPathList[0] else: import urllib cmd += autPathList[0] + "%3F" + urllib.quote(autPathList[1])
def getStartCmd(self, aut, browser, options, simulationScript=None, seleniumVersion=None): path = self.seleniumConf["seleniumDir"] + "/" + seleniumVersion cmd = "java"
bc36e11a51885983e03d13ed6fd086e51b99dcd2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5718/bc36e11a51885983e03d13ed6fd086e51b99dcd2/qxtest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8635, 5931, 12, 2890, 16, 2059, 16, 4748, 16, 702, 16, 14754, 3651, 33, 7036, 16, 29480, 1444, 33, 7036, 4672, 589, 273, 365, 18, 1786, 17327, 3976, 9614, 1786, 17327, 1621, 11929, 397, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 8635, 5931, 12, 2890, 16, 2059, 16, 4748, 16, 702, 16, 14754, 3651, 33, 7036, 16, 29480, 1444, 33, 7036, 4672, 589, 273, 365, 18, 1786, 17327, 3976, 9614, 1786, 17327, 1621, 11929, 397, ...
msg += "./run.sh %s %s" % (int(nEvents),seedsMadgraph[0])
msg += "export PBS_O_WORKDIR=\"\"; ./run.sh %s %s" % (int(nEvents),seedsMadgraph[0])
def madgraph(): """ Generator dependent from here """ # First line in the config file is the generator name file = open(cfgFile, 'r') generatorLine = file.readline() # Not used nameLabelLine = file.readline() nameLabel = nameLabelLine.split('\n') tarballAreaLabel = file.readline() tarballArea = tarballAreaLabel.split('\n') if tarballArea[0].strip() == "NONE": msg = "wget --no-check-certificate -O %s.tar.gz \"http://cmssw.cvs.cern.ch/cgi-bin/cmssw.cgi/UserCode/RobertoChierici/MadGraphCompiledTarballs/%s.tar.gz?view=co\";" % (nameLabel[0].strip(),nameLabel[0].strip()) msg += "tar xvzf %s.tar.gz;" % nameLabel[0].strip() os.system(msg) else: msg = "wget --no-check-certificate -O %s.tar.gz \"%s/%s.tar.gz\";" % (nameLabel[0].strip(),tarballArea[0].strip(),nameLabel[0].strip()) msg += "tar xvzf %s.tar.gz;" % nameLabel[0].strip() msg += "cd madevent;" msg += "./bin/compile dynamic;" msg += "./bin/clean4grid;" os.system(msg) numberOfSeedsNeeded = 1 random.seed(int(seeds)) seedsMadgraph = [] for i in range(0, numberOfSeedsNeeded): seedsMadgraph.append(random.randint(1,99999999)) try: msg = "chmod a+x run.sh;" msg += "./run.sh %s %s" % (int(nEvents),seedsMadgraph[0]) os.system(msg) except Exception, ex: return 1 """ Making links and providing some information """ try: msg = "rm -f nCmsGenEvents.txt;" msg += "echo `grep \"Number of Events\" madevent/Events/events.lhe | awk '{print$6}'` > nCmsGenEvents.txt;" os.system(msg) except Exception, ex: return 4 try: msg = "mv events.lhe.gz %s_events.lhe.gz;" % nameLabel[0].strip() msg += "gunzip %s_events.lhe.gz;" % nameLabel[0].strip() msg += "cd ../cmsRun1; ln -s ../cmsGen1/%s_events.lhe .;" % nameLabel[0].strip() os.system(msg) except Exception, ex: return 5 global outputFile outputFile = "%s_events.lhe" % nameLabel[0].strip() return 0
b0cc368dcf9ba1dd8d3cabcfbff72f484851adec /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8886/b0cc368dcf9ba1dd8d3cabcfbff72f484851adec/cmsGen.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 361, 4660, 13332, 3536, 10159, 10460, 628, 2674, 3536, 468, 5783, 980, 316, 326, 642, 585, 353, 326, 4456, 508, 585, 1377, 273, 1696, 12, 7066, 812, 16, 296, 86, 6134, 4456, 1670, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 361, 4660, 13332, 3536, 10159, 10460, 628, 2674, 3536, 468, 5783, 980, 316, 326, 642, 585, 353, 326, 4456, 508, 585, 1377, 273, 1696, 12, 7066, 812, 16, 296, 86, 6134, 4456, 1670, ...
TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL'])
TargetAdd('interrogate.exe', opts=['ADVAPI', 'OPENSSL', 'WINSHELL'])
pandaversion_h += "\n#undef PANDA_OFFICIAL_VERSION\n"
df94195ce3f8ffd384b0a72bb5770e836e9e9d2e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8543/df94195ce3f8ffd384b0a72bb5770e836e9e9d2e/makepanda.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 293, 464, 842, 722, 67, 76, 1011, 1548, 82, 7, 318, 536, 225, 453, 4307, 37, 67, 3932, 1653, 39, 6365, 67, 5757, 64, 82, 6, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 293, 464, 842, 722, 67, 76, 1011, 1548, 82, 7, 318, 536, 225, 453, 4307, 37, 67, 3932, 1653, 39, 6365, 67, 5757, 64, 82, 6, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
print "copied" shutil.copytree(geni_svn, geni_root)
shutil.copytree(geni_svn, geni_root, symlinks=True) print "copied successfully (symlinks intact)"
def main(): if not len(sys.argv) == 3: print "python deploy_geni_control <geni_root> <svn_root>" return geni_root = sys.argv[1] svn_trunk = sys.argv[2] # check for existence of svn trunk if not os.path.isdir(svn_trunk): print "ERROR: the path to the SVN root given does not exist." return # warn the user if we're about to overwrite files if os.path.isdir(geni_root): ans = raw_input("WARNING: directory found at geni_root location. Delete? [y/n]") ans = str.lower(ans) if not ans == 'y': exit() else: shutil.rmtree(geni_root) # copy over most recent build of geni from SVN to specified directory if not svn_trunk.endswith("/"): svn_trunk += "/" geni_svn = svn_trunk + "www/geni/" print "copied" shutil.copytree(geni_svn, geni_root) # alpers - moves dir to actual repy dir if not geni_root.endswith("/"): geni_root += "/" geni_repy = geni_root + "control/repy_dist" # make the repy directory if it doesn't exist if not os.path.isdir(geni_repy): os.mkdir(geni_repy) # need to modify argument so preparetest can pick it up sys.argv[1] = geni_repy # this is for preparetest to work current_dir = os.getcwd() # makes this a full path, otherwise preparetest doesn't like it if not os.path.isabs(sys.argv[1]): sys.argv[1] = os.path.abspath(sys.argv[1]) os.chdir(svn_trunk) target_dir = sys.argv[1] print sys.argv[1] preparetest.main() # set working directory back to the folder we've started in os.chdir(current_dir) # alpers - I don't think this is necessary since all dependencies are # using the fully qualified name # copy files to target dir (this is supposed to be geni/control) preparetest.copy_to_target(target_dir + "/../*.mix", target_dir) # set working dir to target os.chdir(target_dir) # call the process_mix function to process all mix files in the target directory preparetest.process_mix("repypp.py") # go back to root project directory os.chdir(current_dir)
07b3a453481b3c8118df64a82af8013c3fe8f315 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7995/07b3a453481b3c8118df64a82af8013c3fe8f315/deploy_geni_control.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 225, 309, 486, 562, 12, 9499, 18, 19485, 13, 422, 890, 30, 1172, 315, 8103, 7286, 67, 4507, 77, 67, 7098, 411, 4507, 77, 67, 3085, 34, 411, 31505, 67, 3085, 2984, 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, 2774, 13332, 225, 309, 486, 562, 12, 9499, 18, 19485, 13, 422, 890, 30, 1172, 315, 8103, 7286, 67, 4507, 77, 67, 7098, 411, 4507, 77, 67, 3085, 34, 411, 31505, 67, 3085, 2984, 327, 2...
lambda: node.unlink(),
lambda: self.node.unlink(),
def testOffscreen(self): Player.loadSceneString(""" <?xml version="1.0"?> <scene id="testscene" width="160" height="120"> <image id="test1" href="rgb24-65x65.png" angle="0.4"/> </scene> """) self._loadEmpty() node = avg.ImageNode(href="scene:testscene", parent=Player.getRootNode()) self.start(None, (None, lambda: self.compareImage("testOffscreen1", False), lambda: node.unlink(), lambda: self.compareImage("testOffscreen2", False), lambda: Player.getRootNode().appendChild(node), lambda: self.compareImage("testOffscreen1", False) ))
db1a10546b5f6a758aeab43f5c1a69819798ce2b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7300/db1a10546b5f6a758aeab43f5c1a69819798ce2b/PlayerTest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 7210, 9252, 12, 2890, 4672, 19185, 18, 945, 14370, 780, 2932, 3660, 20958, 2902, 1177, 1546, 21, 18, 20, 6, 35, 34, 411, 23694, 612, 1546, 3813, 23694, 6, 1835, 1546, 16874, 6, 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, 1842, 7210, 9252, 12, 2890, 4672, 19185, 18, 945, 14370, 780, 2932, 3660, 20958, 2902, 1177, 1546, 21, 18, 20, 6, 35, 34, 411, 23694, 612, 1546, 3813, 23694, 6, 1835, 1546, 16874, 6, 2...
("distance", "INTEGER", None))
("distance", "INTEGER", None)))
def __repr__(self): return "<TripBundle n_trips: %d n_stops: %d>"%(len(self.trip_ids), len(self.pattern_signature[0]))
ead1d94e4947b67095747496b7a9cf0fbc9bcf58 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10974/ead1d94e4947b67095747496b7a9cf0fbc9bcf58/gtfsdb.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 327, 3532, 16148, 3405, 290, 67, 313, 7146, 30, 738, 72, 290, 67, 334, 4473, 30, 738, 72, 2984, 17105, 1897, 12, 2890, 18, 25125, 67, 2232, 3631, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 12715, 972, 12, 2890, 4672, 327, 3532, 16148, 3405, 290, 67, 313, 7146, 30, 738, 72, 290, 67, 334, 4473, 30, 738, 72, 2984, 17105, 1897, 12, 2890, 18, 25125, 67, 2232, 3631, 562,...
if isinstance(obj[0], (CIMClassName, CIMInstanceName)):
if obj and isinstance(obj[0], (CIMClassName, CIMInstanceName)):
def paramvalue(obj): """Return a cim_xml node to be used as the value for a parameter.""" if isinstance(obj, (datetime, timedelta)): obj = cim_types.CIMDateTime(obj) if isinstance(obj, (cim_types.CIMType, bool, StringTypes)): return cim_xml.VALUE(cim_types.atomic_to_cim_xml(obj)) if isinstance(obj, (CIMClassName, CIMInstanceName)): return cim_xml.VALUE_REFERENCE(obj.tocimxml()) if isinstance(obj, (CIMClass, CIMInstance)): return cim_xml.VALUE(obj.tocimxml().toxml()) if isinstance(obj, list): if isinstance(obj[0], (CIMClassName, CIMInstanceName)): return cim_xml.VALUE_REFARRAY([paramvalue(x) for x in obj]) return cim_xml.VALUE_ARRAY([paramvalue(x) for x in obj]) raise TypeError('Unsupported parameter type "%s"' % type(obj))
780668a32a5f7666c3b37c49c41def459447c71c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10648/780668a32a5f7666c3b37c49c41def459447c71c/cim_operations.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 579, 1132, 12, 2603, 4672, 3536, 990, 279, 276, 381, 67, 2902, 756, 358, 506, 1399, 487, 326, 460, 364, 279, 1569, 12123, 309, 1549, 12, 2603, 16, 261, 6585, 16, 10661, 3719, 30, 1081,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 579, 1132, 12, 2603, 4672, 3536, 990, 279, 276, 381, 67, 2902, 756, 358, 506, 1399, 487, 326, 460, 364, 279, 1569, 12123, 309, 1549, 12, 2603, 16, 261, 6585, 16, 10661, 3719, 30, 1081,...
def _get_mrna_to_cds(dbase):
def _get_mrna_to_cds(dbase, globalTaxMap):
def _get_mrna_to_cds(dbase): """ Returns: mrna_to_cds (dict) """ # mrna_to_cds: (Dict) # key: (mrna_geneid, mrc_transcript_no) # val: [(cds_start, cds_stop), (cds_start, cds_stop), ...] mrna_to_cds = {} print "Populating: mrna_to_cds" mrna_dbase = dbase.cursor() mrna_dbase.execute("SELECT DISTINCT MRC_GENEID, MRC_TRANSCRIPT_NO, CDS_START, CDS_STOP " "FROM PAP.MRNA_COORDINATES, PAP.CDS_COORDINATES " "WHERE PAP.MRNA_COORDINATES.MRC_GENEID = PAP.CDS_COORDINATES.CDS_GENEID " "AND PAP.MRNA_COORDINATES.MRC_TRANSCRIPT_NO = PAP.CDS_COORDINATES.CDS_TRANSCRIPT_NO " "ORDER BY CDS_START") for row in SQLGenerator(mrna_dbase): assert(row[2] < row[3] + 1) # Start < Stop + 1 mrna_to_cds.setdefault((row[0], row[1]), []).append((row[2], row[3])) mrna_dbase.close() print "Populated.\n" return mrna_to_cds
b850fb892724b1943780db181408ec0a356cd4f5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12607/b850fb892724b1943780db181408ec0a356cd4f5/scan.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 21387, 6582, 67, 869, 67, 71, 2377, 12, 1966, 448, 16, 2552, 7731, 863, 4672, 3536, 2860, 30, 9752, 6582, 67, 869, 67, 71, 2377, 261, 1576, 13, 3536, 468, 9752, 6582, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 588, 67, 21387, 6582, 67, 869, 67, 71, 2377, 12, 1966, 448, 16, 2552, 7731, 863, 4672, 3536, 2860, 30, 9752, 6582, 67, 869, 67, 71, 2377, 261, 1576, 13, 3536, 468, 9752, 6582, 6...
if self.stuckRequests >20: self.theUpdateInterval *= 2 self.theTimer = gtk.timeout_add( self.theUpdateInterval, self.__updateByTimeOut, 0 )
if self.stuckRequests >6: self.theUpdateInterval *= 1.5 self.stuckRequests = 3 self.theTimer = gtk.timeout_add( int(self.theUpdateInterval), self.__updateByTimeOut, 0 )
def __updateByTimeOut( self, arg ): """when time out, calls updates method() Returns None """ if not gtk.events_pending(): self.updateWindows() if self.stuckRequests > 0: self.stuckRequests -= 1 elif self.theUpdateInterval >300: self.theUpdateInterval /=2 else: self.stuckRequests +=1 if self.stuckRequests >20: self.theUpdateInterval *= 2 self.theTimer = gtk.timeout_add( self.theUpdateInterval, self.__updateByTimeOut, 0 )
6c5413018cb534443f2083803d23634e262218d2 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12724/6c5413018cb534443f2083803d23634e262218d2/GtkSessionMonitor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2725, 858, 950, 1182, 12, 365, 16, 1501, 262, 30, 3536, 13723, 813, 596, 16, 4097, 4533, 707, 1435, 2860, 599, 3536, 309, 486, 22718, 18, 5989, 67, 9561, 13332, 365, 18, 2725, 10...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2725, 858, 950, 1182, 12, 365, 16, 1501, 262, 30, 3536, 13723, 813, 596, 16, 4097, 4533, 707, 1435, 2860, 599, 3536, 309, 486, 22718, 18, 5989, 67, 9561, 13332, 365, 18, 2725, 10...
s += ' class="%s"' % self.css_class(obj)
css_class = self.css_class(obj)
def render_cell(self, obj): """ Renders the table cell containing column data. """ rendered_data = self.render_data(obj) s = "<td"
88e532ecfb9f3e56993bd98da84bb2c03beb5954 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6757/88e532ecfb9f3e56993bd98da84bb2c03beb5954/grids.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 3855, 12, 2890, 16, 1081, 4672, 3536, 534, 10130, 326, 1014, 2484, 4191, 1057, 501, 18, 3536, 7935, 67, 892, 273, 365, 18, 5902, 67, 892, 12, 2603, 13, 272, 273, 3532, 4465, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1743, 67, 3855, 12, 2890, 16, 1081, 4672, 3536, 534, 10130, 326, 1014, 2484, 4191, 1057, 501, 18, 3536, 7935, 67, 892, 273, 365, 18, 5902, 67, 892, 12, 2603, 13, 272, 273, 3532, 4465, ...
for encoding in [chardet.detect(input)['encoding'], 'utf8', 'latin1']:
encodings = ['utf8', 'latin1'] doc_enc = chardet.detect(input)['encoding'] if doc_enc: encodings = [doc_enc,] + encodings for encoding in encodings:
def to_unicode(input): if type(input) == str: res = None for encoding in [chardet.detect(input)['encoding'], 'utf8', 'latin1']: try: res = unicode(input, encoding) break; except UnicodeDecodeError: pass if not res: raise Exception('UnicodeDecodeError: could not decode') return res return input
80631324d91676df9177032e06698c83e1405791 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5622/80631324d91676df9177032e06698c83e1405791/string_utils.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 67, 9124, 12, 2630, 4672, 309, 618, 12, 2630, 13, 422, 609, 30, 400, 273, 599, 24118, 273, 10228, 3158, 28, 2187, 296, 26578, 21, 3546, 997, 67, 1331, 273, 462, 1060, 278, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 358, 67, 9124, 12, 2630, 4672, 309, 618, 12, 2630, 13, 422, 609, 30, 400, 273, 599, 24118, 273, 10228, 3158, 28, 2187, 296, 26578, 21, 3546, 997, 67, 1331, 273, 462, 1060, 278, 18, 1...
ci.id = self.name
ci.codec_id = self.name
def _cvt_to_pjsua(self): ci = _pjsua.Codec_Info() ci.id = self.name ci.priority = self.priority return ci
ab3b8bde18a012a34991ed441fb38c325cb113ab /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4447/ab3b8bde18a012a34991ed441fb38c325cb113ab/pjsua.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 71, 11734, 67, 869, 67, 84, 2924, 11886, 12, 2890, 4672, 9039, 273, 389, 84, 2924, 11886, 18, 11008, 67, 966, 1435, 9039, 18, 21059, 67, 350, 273, 365, 18, 529, 9039, 18, 8457, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 389, 71, 11734, 67, 869, 67, 84, 2924, 11886, 12, 2890, 4672, 9039, 273, 389, 84, 2924, 11886, 18, 11008, 67, 966, 1435, 9039, 18, 21059, 67, 350, 273, 365, 18, 529, 9039, 18, 8457, ...
for gmlist in lists_of_member(mlist.host_name, user):
for gmlist in lists_of_member(mlist, user) + [mlist]:
def main(): doc = Document() doc.set_language(mm_cfg.DEFAULT_SERVER_LANGUAGE) parts = Utils.GetPathPieces() lenparts = parts and len(parts) if not parts or lenparts < 1: title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) add_error_message(doc, _('Invalid options to CGI script.')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() return # get the list and user's name listname = parts[0].lower() # open list try: mlist = MailList.MailList(listname, lock=0) except Errors.MMListError, e: # Avoid cross-site scripting attacks safelistname = cgi.escape(listname) title = _('CGI script error') doc.SetTitle(title) doc.AddItem(Header(2, title)) add_error_message(doc, _('No such list <em>%(safelistname)s</em>')) doc.AddItem('<hr>') doc.AddItem(MailmanLogo()) print doc.Format() syslog('error', 'No such list "%s": %s\n', listname, e) return # The total contents of the user's response cgidata = cgi.FieldStorage(keep_blank_values=1) # Set the language for the page. If we're coming from the listinfo cgi, # we might have a 'language' key in the cgi data. That was an explicit # preference to view the page in, so we should honor that here. If that's # not available, use the list's default language. language = cgidata.getvalue('language', mlist.preferred_language) i18n.set_language(language) doc.set_language(language) if lenparts < 2: user = cgidata.getvalue('email') if not user: loginpage(mlist, doc, None, cgidata) print doc.Format() return else: user = Utils.LCDomain(Utils.UnobscureEmail(SLASH.join(parts[1:]))) # Sanity check the user, but be careful about leaking membership # information when we're using private rosters. if not mlist.isMember(user) and mlist.private_roster == 0: # Avoid cross-site scripting attacks safeuser = cgi.escape(user) add_error_message(doc, _('No such member: %(safeuser)s.')) loginpage(mlist, doc, None, cgidata) print doc.Format() return # Find the case preserved email address (the one the user subscribed with) lcuser = user.lower() try: cpuser = mlist.getMemberCPAddress(lcuser) except Errors.NotAMemberError: # This happens if the user isn't a member but we've got private rosters cpuser = None if lcuser == cpuser: cpuser = None # And now we know the user making the request, so set things up to for the # user's stored preferred language, overridden by any form settings for # their new language preference. userlang = cgidata.getvalue('language', mlist.getMemberLanguage(user)) doc.set_language(userlang) i18n.set_language(userlang) # See if this is VARHELP on topics. varhelp = None if cgidata.has_key('VARHELP'): varhelp = cgidata['VARHELP'].value elif cgidata.has_key('request_login') and os.environ.get('QUERY_STRING'): # POST methods, even if their actions have a query string, don't get # put into FieldStorage's keys :-( qs = cgi.parse_qs(os.environ['QUERY_STRING']).get('VARHELP') if qs and type(qs) == types.ListType: varhelp = qs[0] if varhelp: topic_details(mlist, doc, user, cpuser, userlang, varhelp) return # Are we processing an unsubscription request from the login screen? if cgidata.has_key('login-unsub'): # Because they can't supply a password for unsubscribing, we'll need # to do the confirmation dance. if mlist.isMember(user): mlist.ConfirmUnsubscription(user, userlang) else: syslog('mischief', 'Unsubscribe attempt of non-member w/ private rosters: %s', user) add_error_message( doc, _('The confirmation email has been sent.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Are we processing a password reminder from the login screen? if cgidata.has_key('login-remind'): if mlist.isMember(user): mlist.MailUserPassword(user) else: syslog('mischief', 'Reminder attempt of non-member w/ private rosters: %s', user) add_error_message( doc, _('A reminder of your password has been emailed to you.'), tag='') loginpage(mlist, doc, user, cgidata) print doc.Format() return # Authenticate, possibly using the password supplied in the login page password = cgidata.getvalue('password', '').strip() if not mlist.WebAuthenticate((mm_cfg.AuthUser, mm_cfg.AuthListAdmin, mm_cfg.AuthSiteAdmin), password, user): # Not authenticated, so throw up the login page again. If they tried # to authenticate via cgi (instead of cookie), then print an error # message. if cgidata.has_key('password'): add_error_message(doc, _('Authentication failed.')) # So as not to allow membership leakage, prompt for the email # address and the password here. if mlist.private_roster <> 0: syslog('mischief', 'Login failure with private rosters: %s', user) user = None loginpage(mlist, doc, user, cgidata) print doc.Format() return # From here on out, the user is okay to view and modify their membership # options. The first set of checks does not require the list to be # locked. if cgidata.has_key('logout'): print mlist.ZapCookie(mm_cfg.AuthUser, user) loginpage(mlist, doc, user, cgidata) print doc.Format() return if cgidata.has_key('emailpw'): mlist.MailUserPassword(user) options_page( mlist, doc, user, cpuser, userlang, _('A reminder of your password has been emailed to you.')) print doc.Format() return if cgidata.has_key('othersubs'): hostname = mlist.host_name title = _('List subscriptions for %(user)s on %(hostname)s') doc.SetTitle(title) doc.AddItem(Header(2, title)) doc.AddItem(_('''Click on a link to visit your options page for the requested mailing list.''')) # Troll through all the mailing lists that match host_name and see if # the user is a member. If so, add it to the list. onlists = [] for gmlist in lists_of_member(mlist.host_name, user): url = gmlist.GetOptionsURL(user) link = Link(url, gmlist.real_name) onlists.append((gmlist.real_name, link)) onlists.sort() items = OrderedList(*[link for name, link in onlists]) doc.AddItem(items) print doc.Format() return if cgidata.has_key('change-of-address'): # We could be changing the user's full name, email address, or both membername = cgidata.getvalue('fullname') newaddr = cgidata.getvalue('new-address') confirmaddr = cgidata.getvalue('confirm-address') oldname = mlist.getMemberName(user) set_address = set_membername = 0 # We will change the member's name under the following conditions: # - membername has a value # - membername has no value, but they /used/ to have a membername if membername and membername <> oldname: # Setting it to a new value set_membername = 1 if not membername and oldname: # Unsetting it set_membername = 1 # We will change the user's address if both newaddr and confirmaddr # are non-blank, have the same value, and aren't the currently # subscribed email address (when compared case-sensitively). If both # are blank, but membername is set, we ignore it, otherwise we print # an error. if newaddr and confirmaddr: if newaddr <> confirmaddr: options_page(mlist, doc, user, cpuser, userlang, _('Addresses did not match!')) print doc.Format() return if newaddr == user: options_page(mlist, doc, user, cpuser, userlang, _('You are already using that email address')) print doc.Format() return set_address = 1 elif (newaddr or confirmaddr) and not set_membername: options_page(mlist, doc, user, cpuser, userlang, _('Addresses may not be blank')) print doc.Format() return # See if the user wants to change their email address globally globally = cgidata.getvalue('changeaddr-globally') # Standard sigterm handler. def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) signal.signal(signal.SIGTERM, sigterm_handler) msg = '' if set_address: # Register the pending change after the list is locked msg = _('A confirmation message has been sent to %(newaddr)s') mlist.Lock() try: try: mlist.ChangeMemberAddress(user, newaddr, globally) mlist.Save() finally: mlist.Unlock() except Errors.MMBadEmailError: msg = _('Bad email address provided') except Errors.MMHostileAddress: msg = _('Illegal email address provided') except Errors.MMAlreadyAMember: msg = _('%(newaddr)s is already a member of the list.') if set_membername: mlist.Lock() try: mlist.ChangeMemberName(user, membername, globally) mlist.Save() finally: mlist.Unlock() msg += _('Member name successfully changed.') options_page(mlist, doc, user, cpuser, userlang, msg) print doc.Format() return if cgidata.has_key('changepw'): newpw = cgidata.getvalue('newpw') confirmpw = cgidata.getvalue('confpw') if not newpw or not confirmpw: options_page(mlist, doc, user, cpuser, userlang, _('Passwords may not be blank')) print doc.Format() return if newpw <> confirmpw: options_page(mlist, doc, user, cpuser, userlang, _('Passwords did not match!')) print doc.Format() return # See if the user wants to change their passwords globally if cgidata.getvalue('pw-globally'): mlists = lists_of_member(mlist.host_name, user) else: mlists = [mlist] for gmlist in mlists: change_password(gmlist, user, newpw, confirmpw) # Regenerate the cookie so a re-authorization isn't necessary print mlist.MakeCookie(mm_cfg.AuthUser, user) options_page(mlist, doc, user, cpuser, userlang, _('Password successfully changed.')) print doc.Format() return if cgidata.has_key('unsub'): # Was the confirming check box turned on? if not cgidata.getvalue('unsubconfirm'): options_page( mlist, doc, user, cpuser, userlang, _('''You must confirm your unsubscription request by turning on the checkbox below the <em>Unsubscribe</em> button. You have not been unsubscribed!''')) print doc.Format() return # Standard signal handler def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) # Okay, zap them. Leave them sitting at the list's listinfo page. We # must own the list lock, and we want to make sure the user (BAW: and # list admin?) is informed of the removal. signal.signal(signal.SIGTERM, sigterm_handler) mlist.Lock() needapproval = 0 try: try: mlist.DeleteMember( user, _('via the member options page'), userack=1) except Errors.MMNeedApproval: needapproval = 1 mlist.Save() finally: mlist.Unlock() # Now throw up some results page, with appropriate links. We can't # drop them back into their options page, because that's gone now! fqdn_listname = mlist.GetListEmail() owneraddr = mlist.GetOwnerEmail() url = mlist.GetScriptURL('listinfo', absolute=1) title = _('Unsubscription results') doc.SetTitle(title) doc.AddItem(Header(2, title)) if needapproval: doc.AddItem(_("""Your unsubscription request has been received and forwarded on to the list moderators for approval. You will receive notification once the list moderators have made their decision.""")) else: doc.AddItem(_("""You have been successfully unsubscribed from the mailing list %(fqdn_listname)s. If you were receiving digest deliveries you may get one more digest. If you have any questions about your unsubscription, please contact the list owners at %(owneraddr)s.""")) doc.AddItem(mlist.GetMailmanFooter()) print doc.Format() return if cgidata.has_key('options-submit'): # Digest action flags digestwarn = 0 cantdigest = 0 mustdigest = 0 newvals = [] # First figure out which options have changed. The item names come # from FormatOptionButton() in HTMLFormatter.py for item, flag in (('digest', mm_cfg.Digests), ('mime', mm_cfg.DisableMime), ('dontreceive', mm_cfg.DontReceiveOwnPosts), ('ackposts', mm_cfg.AcknowledgePosts), ('disablemail', mm_cfg.DisableDelivery), ('conceal', mm_cfg.ConcealSubscription), ('remind', mm_cfg.SuppressPasswordReminder), ('rcvtopic', mm_cfg.ReceiveNonmatchingTopics), ): try: newval = int(cgidata.getvalue(item)) except (TypeError, ValueError): newval = None # Skip this option if there was a problem or it wasn't changed. # Note that delivery status is handled separate from the options # flags. if newval is None: continue elif flag == mm_cfg.DisableDelivery: status = mlist.getDeliveryStatus(user) # Here, newval == 0 means enable, newval == 1 means disable if not newval and status <> MemberAdaptor.ENABLED: newval = MemberAdaptor.ENABLED elif newval and status == MemberAdaptor.ENABLED: newval = MemberAdaptor.BYUSER else: continue elif newval == mlist.getMemberOption(user, flag): continue newvals.append((flag, newval)) # The user language is handled a little differently if userlang not in mlist.GetAvailableLanguages(): newvals.append((SETLANGUAGE, mlist.preferred_language)) else: newvals.append((SETLANGUAGE, userlang)) # Process user selected topics, but don't make the changes to the # MailList object; we must do that down below when the list is # locked. topicnames = cgidata.getvalue('usertopic') if topicnames: # Some topics were selected. topicnames can actually be a string # or a list of strings depending on whether more than one topic # was selected or not. if not isinstance(topicnames, ListType): # Assume it was a bare string, so listify it topicnames = [topicnames] # unquote the topic names topicnames = [urllib.unquote_plus(n) for n in topicnames] # The standard sigterm handler (see above) def sigterm_handler(signum, frame, mlist=mlist): mlist.Unlock() sys.exit(0) # Now, lock the list and perform the changes mlist.Lock() try: signal.signal(signal.SIGTERM, sigterm_handler) # `values' is a tuple of flags and the web values for flag, newval in newvals: # Handle language settings differently if flag == SETLANGUAGE: mlist.setMemberLanguage(user, newval) # Handle delivery status separately elif flag == mm_cfg.DisableDelivery: mlist.setDeliveryStatus(user, newval) else: mlist.setMemberOption(user, flag, newval) # Set the topics information. mlist.setMemberTopics(user, topicnames) mlist.Save() finally: mlist.Unlock() # The enable/disable option and the password remind option may have # their global flags sets. global_enable = None if cgidata.getvalue('deliver-globally'): # Yes, this is inefficient, but the list is so small it shouldn't # make much of a difference. for flag, newval in newvals: if flag == mm_cfg.DisableDelivery: global_enable = newval break global_remind = None if cgidata.getvalue('remind-globally'): for flag, newval in newvals: if flag == mm_cfg.SuppressPasswordReminder: global_remind = newval break if global_enable is not None or global_remind is not None: for gmlist in lists_of_member(mlist.host_name, user): global_options(gmlist, user, global_enable, global_remind) # Now print the results if cantdigest: msg = _('''The list administrator has disabled digest delivery for this list, so your delivery option has not been set. However your other options have been set successfully.''') elif mustdigest: msg = _('''The list administrator has disabled non-digest delivery for this list, so your delivery option has not been set. However your other options have been set successfully.''') else: msg = _('You have successfully set your options.') if digestwarn: msg += _('You may get one last digest.') options_page(mlist, doc, user, cpuser, userlang, msg) print doc.Format() return options_page(mlist, doc, user, cpuser, userlang) print doc.Format()
a7f380be49e23e0d437145d5b34c215cbecbaacf /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/a7f380be49e23e0d437145d5b34c215cbecbaacf/options.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 997, 273, 4319, 1435, 997, 18, 542, 67, 4923, 12, 7020, 67, 7066, 18, 5280, 67, 4370, 67, 15547, 13, 225, 2140, 273, 6091, 18, 967, 743, 16539, 8610, 1435, 562, 6019, 273,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2774, 13332, 997, 273, 4319, 1435, 997, 18, 542, 67, 4923, 12, 7020, 67, 7066, 18, 5280, 67, 4370, 67, 15547, 13, 225, 2140, 273, 6091, 18, 967, 743, 16539, 8610, 1435, 562, 6019, 273,...
(r'(<[^>]*>)', Name.Variable),
(r'(<[^>]+>)', Name.Variable),
def word_callback(lexer, match): word = match.group()
fae05f39855d6d05bfbeb4c1eeae858e90e14c74 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6148/fae05f39855d6d05bfbeb4c1eeae858e90e14c74/other.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2076, 67, 3394, 12, 31731, 16, 845, 4672, 2076, 273, 845, 18, 1655, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 2076, 67, 3394, 12, 31731, 16, 845, 4672, 2076, 273, 845, 18, 1655, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -...
f = open(TESTFN, 'w+') data = 'aabaac\x00deef\x00\x00aa\x00'
f = open(TESTFN, 'wb+') data = b'aabaac\x00deef\x00\x00aa\x00'
def test_tougher_find(self): # Do a tougher .find() test. SF bug 515943 pointed out that, in 2.2, # searching for data with embedded \0 bytes didn't work. f = open(TESTFN, 'w+')
d5ab51392e332ac6a7a37b2fca62a82b1aee9ec7 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8125/d5ab51392e332ac6a7a37b2fca62a82b1aee9ec7/test_mmap.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 869, 637, 1614, 67, 4720, 12, 2890, 4672, 468, 2256, 279, 358, 637, 1614, 263, 4720, 1435, 1842, 18, 225, 21318, 7934, 1381, 24872, 8942, 25874, 596, 716, 16, 316, 576, 18, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 869, 637, 1614, 67, 4720, 12, 2890, 4672, 468, 2256, 279, 358, 637, 1614, 263, 4720, 1435, 1842, 18, 225, 21318, 7934, 1381, 24872, 8942, 25874, 596, 716, 16, 316, 576, 18, 2...
context.env['ENV']['WXCFG'] = 'vc_lib\msw' if SystemWXConfig(context.env,'--libs')[0] == 0:
args = "--debug=false" if SystemWXConfig(context.env, args + ' --libs')[0] == 0:
def CheckWXConfigWin(context, version, debug): context.Message('Checking for wxWidgets >= %s... '%version) # Try to find it in path wx_prog = context.env.WhereIs(context.env['wxconfig']) if wx_prog == None: # You could supply wx-config.exe as a fallback option. #wx_prog = os.path.join('scons','wx-config') context.Message('wx-config not found...') return False context.env['wxconfig'] = wx_prog # Some environment variables are required for wx-config to work, check them. if 'WXWIN' not in context.env['ENV']: # TODO: maybe try some default location like "C:\Program Files\wxWidgets-*" or registry context.Message('please set WXWIN in environment... ') return False # If there's no WXCFG, either there is only one config or we try to find out. if 'WXCFG' not in context.env['ENV']: # TODO: try to find one in some sensible order from alternatives # Current guess is: visual studio static, non-unicode # Try debugging version first if requested, else fallback to release if debug: context.env['ENV']['WXCFG'] = 'vc_lib\mswd' if SystemWXConfig(context.env,'--libs')[0] == 0: return CheckWXConfigVersion(context, version) # Non-debug context.env['ENV']['WXCFG'] = 'vc_lib\msw' if SystemWXConfig(context.env,'--libs')[0] == 0: # this is the only configuration: use it return CheckWXConfigVersion(context, version) context.Message('please set WXCFG in environment... ') return False # WXCFG is in environment, nice. # Try a debugging version if requested: postfix WXCFG with 'd' if debug: oldwxcfg = context.env['ENV']['WXCFG'] context.env['ENV']['WXCFG'] += 'd' if SystemWXConfig(context.env,'--libs')[0] == 0: return CheckWXConfigVersion(context, version) # Failed: revert to plain WXCFG, use existing environment context.env['ENV']['WXCFG'] = oldwxcfg if SystemWXConfig(context.env,'--libs')[0] == 0: return CheckWXConfigVersion(context, version) # Everything failed ... return False
400eec23325bbbde4541728d9b3317ee296659f4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2901/400eec23325bbbde4541728d9b3317ee296659f4/wxconfig.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2073, 59, 60, 809, 18049, 12, 2472, 16, 1177, 16, 1198, 4672, 819, 18, 1079, 2668, 14294, 364, 7075, 16166, 1545, 738, 87, 2777, 1995, 1589, 13, 225, 468, 6161, 358, 1104, 518, 316, 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, 2073, 59, 60, 809, 18049, 12, 2472, 16, 1177, 16, 1198, 4672, 819, 18, 1079, 2668, 14294, 364, 7075, 16166, 1545, 738, 87, 2777, 1995, 1589, 13, 225, 468, 6161, 358, 1104, 518, 316, 58...
if target_: args.append(target_)
if target: args.append(target)
def phing(ctxt, file_=None, target_=None, executable_=None, args=None): """Run a phing build""" if args: args = shlex.split(args) else: args = [] args += ['-logger', 'phing.listener.DefaultLogger', '-buildfile', ctxt.resolve(file_ or 'build.xml')] if target_: args.append(target_) returncode = shtools.execute(ctxt, file_= executable_ or 'phing', args=args) if returncode != 0: ctxt.error('Phing failed (%s)' % returncode)
a7d6626798d47be0a00ed66cefd977250650a604 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4547/a7d6626798d47be0a00ed66cefd977250650a604/phptools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1844, 310, 12, 20364, 16, 585, 67, 33, 7036, 16, 1018, 67, 33, 7036, 16, 9070, 67, 33, 7036, 16, 833, 33, 7036, 4672, 3536, 1997, 279, 1844, 310, 1361, 8395, 309, 833, 30, 833, 273, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1844, 310, 12, 20364, 16, 585, 67, 33, 7036, 16, 1018, 67, 33, 7036, 16, 9070, 67, 33, 7036, 16, 833, 33, 7036, 4672, 3536, 1997, 279, 1844, 310, 1361, 8395, 309, 833, 30, 833, 273, ...
options for lines which are also available.
options for lines, which are also available.
def ruler(start, end, ticks=4, sub_ticks=4, absolute=False, snap=False, **kwds): """ Draw a ruler in 3D, with major and minor ticks. INPUT: - ``start`` - the beginning of the ruler, as a list, tuple, or vector - ``end`` - the end of the ruler, as a list, tuple, or vector - ``ticks`` - (default: 4) the number of major ticks shown on the ruler - ``sub_ticks`` - (default: 4) the number of shown subdivisions between each major tick - ``absolute`` - (default: False) if True, makes a huge ruler in the direction of an axis - ``snap`` - (default: False) if True, snaps to an implied grid Type ``line3d.options`` for a dictionary of the default options for lines which are also available. EXAMPLES: A ruler:: sage: from sage.plot.plot3d.shapes2 import ruler sage: R = ruler([1,2,3],vector([2,3,4])); R A ruler with some options:: sage: R = ruler([1,2,3],vector([2,3,4]),ticks=6, sub_ticks=2, color='red'); R The keyword ``snap`` makes the ticks not necessarily coincide with the ruler:: sage: ruler([1,2,3],vector([1,2,4]),snap=True) The keyword ``absolute`` makes a huge ruler in one of the axis directions:: sage: ruler([1,2,3],vector([1,2,4]),absolute=True) TESTS:: sage: ruler([1,2,3],vector([1,3,4]),absolute=True) Traceback (most recent call last): ... ValueError: Absolute rulers only valid for axis-aligned paths """ start = vector(RDF, start) end = vector(RDF, end) dir = end - start dist = math.sqrt(dir.dot_product(dir)) dir /= dist one_tick = dist/ticks * 1.414 unit = 10 ** math.floor(math.log(dist/ticks, 10)) if unit * 5 < one_tick: unit *= 5 elif unit * 2 < one_tick: unit *= 2 if dir[0]: tick = dir.cross_product(vector(RDF, (0,0,-dist/30))) elif dir[1]: tick = dir.cross_product(vector(RDF, (0,0,dist/30))) else: tick = vector(RDF, (dist/30,0,0)) if snap: for i in range(3): start[i] = unit * math.floor(start[i]/unit + 1e-5) end[i] = unit * math.ceil(end[i]/unit - 1e-5) if absolute: if dir[0]*dir[1] or dir[1]*dir[2] or dir[0]*dir[2]: raise ValueError, "Absolute rulers only valid for axis-aligned paths" m = max(dir[0], dir[1], dir[2]) if dir[0] == m: off = start[0] elif dir[1] == m: off = start[1] else: off = start[2] first_tick = unit * math.ceil(off/unit - 1e-5) - off else: off = 0 first_tick = 0 ruler = shapes.LineSegment(start, end, **kwds) for k in range(1, int(sub_ticks * first_tick/unit)): P = start + dir*(k*unit/sub_ticks) ruler += shapes.LineSegment(P, P + tick/2, **kwds) for d in srange(first_tick, dist + unit/(sub_ticks+1), unit): P = start + dir*d ruler += shapes.LineSegment(P, P + tick, **kwds) ruler += shapes.Text(str(d+off), **kwds).translate(P - tick) if dist - d < unit: sub_ticks = int(sub_ticks * (dist - d)/unit) for k in range(1, sub_ticks): P += dir * (unit/sub_ticks) ruler += shapes.LineSegment(P, P + tick/2, **kwds) return ruler
ac565fa7b2ba6c3b1ae16697410547f7b11f5dcf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/ac565fa7b2ba6c3b1ae16697410547f7b11f5dcf/shapes2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 436, 17040, 12, 1937, 16, 679, 16, 13003, 33, 24, 16, 720, 67, 11767, 33, 24, 16, 4967, 33, 8381, 16, 10915, 33, 8381, 16, 2826, 25577, 4672, 3536, 10184, 279, 436, 17040, 316, 890, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 436, 17040, 12, 1937, 16, 679, 16, 13003, 33, 24, 16, 720, 67, 11767, 33, 24, 16, 4967, 33, 8381, 16, 10915, 33, 8381, 16, 2826, 25577, 4672, 3536, 10184, 279, 436, 17040, 316, 890, ...
resources = Manifest()
resources = ""
def colonize(self, fleet,report): if self.owner != None and self.owner != fleet.owner: # colonization doesn't happen if the planet is already colonized # (someone beat you to it, sorry...) report.append("Cancelled Colony: Fleet #" + str(fleet.id) + " returning home from" + str(self.name) + " ("+str(self.id)+") -- Planet already owned.") fleet.gotoplanet(fleet.homeport) else: if self.owner == None: report.append("New Colony: Fleet #" + str(fleet.id) + " started colony at " + str(self.name) + " ("+str(self.id)+")") else: report.append("Bolstered Colony: Fleet #" + str(fleet.id) + " bolstered colony at " + str(self.name) + " ("+str(self.id)+")") resources = Manifest() if self.resources == None: resources = Manifest() else: resources = self.resources numarcs = fleet.arcs
0d4424008ff05d1388e50d303825723b42d06645 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2020/0d4424008ff05d1388e50d303825723b42d06645/models.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13336, 554, 12, 2890, 16, 19764, 16, 6006, 4672, 309, 365, 18, 8443, 480, 599, 471, 365, 18, 8443, 480, 19764, 18, 8443, 30, 468, 13336, 1588, 3302, 1404, 5865, 309, 326, 4995, 278, 35...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13336, 554, 12, 2890, 16, 19764, 16, 6006, 4672, 309, 365, 18, 8443, 480, 599, 471, 365, 18, 8443, 480, 19764, 18, 8443, 30, 468, 13336, 1588, 3302, 1404, 5865, 309, 326, 4995, 278, 35...
l = int(environ["wsgi.input"].readline(), 16)
buf = environ["wsgi.input"].readline() if buf == '': l = 0 else: l = int(buf, 16)
def doPUT(self, environ, start_response): """ @see: http://www.webdav.org/specs/rfc4918.html#METHOD_PUT """ path = environ["PATH_INFO"] provider = self._davProvider res = provider.getResourceInst(path, environ) parentRes = provider.getResourceInst(util.getUriParent(path), environ) isnewfile = res is None
c48715ba2f3cde9c19b1a2790f574eb12d233e87 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8193/c48715ba2f3cde9c19b1a2790f574eb12d233e87/request_server.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 4762, 12, 2890, 16, 5473, 16, 787, 67, 2740, 4672, 3536, 632, 5946, 30, 1062, 2207, 5591, 18, 4875, 20752, 18, 3341, 19, 15115, 19, 16784, 7616, 2643, 18, 2620, 7, 5327, 67, 4762,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 741, 4762, 12, 2890, 16, 5473, 16, 787, 67, 2740, 4672, 3536, 632, 5946, 30, 1062, 2207, 5591, 18, 4875, 20752, 18, 3341, 19, 15115, 19, 16784, 7616, 2643, 18, 2620, 7, 5327, 67, 4762,...
dword = struct.unpack('I', self.__data__[ i*4 : i*4+4 ])[0]
dword = struct.unpack('I', data[ i*4 : i*4+4 ])[0]
def generate_checksum(self): # This will make sure that the data represeting the PE image # is updated with any changes that might have been made by # assigning values to header fields as those are not automatically # updated upon assignment. # self.__data__ = self.write() # Get the offset to the CheckSum field in the OptionalHeader # checksum_offset = self.OPTIONAL_HEADER.__file_offset__ + 0x40 # 64 checksum = 0 for i in range( len(self.__data__) / 4 ): # Skip the checksum field # if i == checksum_offset / 4: continue dword = struct.unpack('I', self.__data__[ i*4 : i*4+4 ])[0] checksum = (checksum & 0xffffffff) + dword + (checksum>>32) if checksum > 2**32: checksum = (checksum & 0xffffffff) + (checksum >> 32) checksum = (checksum & 0xffff) + (checksum >> 16) checksum = (checksum) + (checksum >> 16) checksum = checksum & 0xffff return checksum + len(self.__data__)
e1251eb908947747306630a5f3afe86cd285b037 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/4177/e1251eb908947747306630a5f3afe86cd285b037/pefile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 15149, 12, 2890, 4672, 225, 468, 1220, 903, 1221, 3071, 716, 326, 501, 2071, 6208, 310, 326, 16628, 1316, 468, 353, 3526, 598, 1281, 3478, 716, 4825, 1240, 2118, 7165, 635, 468...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2103, 67, 15149, 12, 2890, 4672, 225, 468, 1220, 903, 1221, 3071, 716, 326, 501, 2071, 6208, 310, 326, 16628, 1316, 468, 353, 3526, 598, 1281, 3478, 716, 4825, 1240, 2118, 7165, 635, 468...
emailsent = sendAccountActivatedMessage(res[0][1], res[0][1], password)
emailsent = send_account_activated_message(res[0][1], res[0][1], password)
def perform_modifyaccountstatus(req, userID, email_user_pattern, limit_to, maxpage, page, callback='yes', confirm=0): """set a disabled account to enabled and opposite""" (auth_code, auth_message) = is_adminuser(req) if auth_code != 0: return mustloginpage(req, auth_message) res = run_sql("SELECT id, email, note FROM user WHERE id=%s", (userID, )) subtitle = "" output = "" if res: if res[0][2] in [0, "0", None]: res2 = run_sql("UPDATE user SET note=1 WHERE id=%s", (userID, )) output += """<b><span class="info">The account '%s' has been activated.</span></b>""" % res[0][1] if CFG_ACCESS_CONTROL_NOTIFY_USER_ABOUT_ACTIVATION == 1: password = int(random.random() * 1000000) run_sql("UPDATE user SET password=AES_ENCRYPT(email, %s) " "WHERE id=%s", (password, userID)) emailsent = sendAccountActivatedMessage(res[0][1], res[0][1], password) if emailsent: output += """<br /><b><span class="info">An email has been sent to the owner of the account.</span></b>""" else: output += """<br /><b><span class="info">Could not send an email to the owner of the account.</span></b>""" elif res[0][2] in [1, "1"]: res2 = run_sql("UPDATE user SET note=0 WHERE id=%s", (userID, )) output += """<b><span class="info">The account '%s' has been set inactive.</span></b>""" % res[0][1] else: output += '<b><span class="info">The account id given does not exist.</span></b>' body = [output] if callback: return perform_modifyaccounts(req, email_user_pattern, limit_to, maxpage, page, content=output, callback='yes') else: return addadminbox(subtitle, body)
23f82669a784517b3dd8a1acd98ec74aa6e40517 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1931/23f82669a784517b3dd8a1acd98ec74aa6e40517/webaccessadmin_lib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 17042, 4631, 2327, 12, 3658, 16, 16299, 16, 2699, 67, 1355, 67, 4951, 16, 1800, 67, 869, 16, 943, 2433, 16, 1363, 16, 1348, 2218, 9707, 2187, 6932, 33, 20, 4672, 3536, 542, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 17042, 4631, 2327, 12, 3658, 16, 16299, 16, 2699, 67, 1355, 67, 4951, 16, 1800, 67, 869, 16, 943, 2433, 16, 1363, 16, 1348, 2218, 9707, 2187, 6932, 33, 20, 4672, 3536, 542, ...
self._decomp = Sequence([DirichletGroup(p**r,R) for p, r \
return Sequence([DirichletGroup(p**r,R) for p, r \
def decomposition(self): r""" Returns the Dirichlet groups of prime power modulus corresponding to primes dividing modulus.
80bb64cda04307dbe55314d6e4fce85c5aab0086 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/80bb64cda04307dbe55314d6e4fce85c5aab0086/dirichlet.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 26288, 12, 2890, 4672, 436, 8395, 2860, 326, 8446, 1354, 1810, 3252, 434, 17014, 7212, 24770, 4656, 358, 846, 4485, 3739, 10415, 24770, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 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, 26288, 12, 2890, 4672, 436, 8395, 2860, 326, 8446, 1354, 1810, 3252, 434, 17014, 7212, 24770, 4656, 358, 846, 4485, 3739, 10415, 24770, 18, 2, -100, -100, -100, -100, -100, -100, -100, -10...
return (z[bisect.bisect(self.x, x), bisect.bisect(self.y.y)],)
return (self.z[bisect.bisect(self.x, x), bisect.bisect(self.y.y)],)
def __call__(self, x, y): return (z[bisect.bisect(self.x, x), bisect.bisect(self.y.y)],)
d023dad95a15c1ac756547f9b27aac194830a6bb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5758/d023dad95a15c1ac756547f9b27aac194830a6bb/ligolw_burca2.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 619, 16, 677, 4672, 327, 261, 94, 63, 70, 291, 386, 18, 70, 291, 386, 12, 2890, 18, 92, 16, 619, 3631, 27031, 18, 70, 291, 386, 12, 2890, 18, 93, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 1991, 972, 12, 2890, 16, 619, 16, 677, 4672, 327, 261, 94, 63, 70, 291, 386, 18, 70, 291, 386, 12, 2890, 18, 92, 16, 619, 3631, 27031, 18, 70, 291, 386, 12, 2890, 18, 93, 1...
if self._input_report_queue:
if self._input_report_queue and self.__input_processing_thread.is_alive():
def close(self): # free parsed data if not self.is_opened(): return self.__open_status = False
99c31ae5bbd5f607698f28c5685c2eaf6283802b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11669/99c31ae5bbd5f607698f28c5685c2eaf6283802b/core.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 468, 4843, 2707, 501, 309, 486, 365, 18, 291, 67, 25304, 13332, 327, 365, 16186, 3190, 67, 2327, 273, 1083, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1746, 12, 2890, 4672, 468, 4843, 2707, 501, 309, 486, 365, 18, 291, 67, 25304, 13332, 327, 365, 16186, 3190, 67, 2327, 273, 1083, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
setSite(plone)
if not pre_plone3: setSite(portal)
def create(app, site_id, products_initial, profiles_initial, site_replace): oids = app.objectIds() if site_id in oids: if site_replace and hasattr(app, site_id): if pre_plone3: app.manage_delObjects([site_id,]) else: try: app.manage_delObjects([site_id,]) except LinkIntegrityNotificationException: pass transaction.commit() print "Removed existing Plone Site" oids = app.objectIds() else: print "A Plone Site already exists and will not be replaced" return # actually add in Plone if site_id not in oids: if version is not None and version.PLONE40: # we have to simulate the new zmi admin screen here - at # least provide: # extension_ids # setup_content (plone default is currently 'true') from Products.CMFPlone.factory import addPloneSite extension_profiles = ( 'plonetheme.classic:default', 'plonetheme.sunburst:default' ) addPloneSite( app, site_id, extension_ids=extension_profiles, setup_content=False ) else: factory = app.manage_addProduct['CMFPlone'] factory.addPloneSite(site_id, create_userfolder=1) # commit the new site to the database transaction.commit() print "Added Plone Site" # install some products plone = getattr(app, site_id) # set the site so that the component architecture will work # properly setSite(plone) if plone: quickinstall(plone, products_initial) # run GS profiles runProfiles(plone, profiles_initial) print "Finished"
b273f191d21bb4804d07e25c1979f093d5f9cc21 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10968/b273f191d21bb4804d07e25c1979f093d5f9cc21/plonesite.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2910, 16, 2834, 67, 350, 16, 10406, 67, 6769, 16, 11788, 67, 6769, 16, 2834, 67, 2079, 4672, 26629, 273, 595, 18, 1612, 2673, 1435, 309, 2834, 67, 350, 316, 26629, 30, 309, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2910, 16, 2834, 67, 350, 16, 10406, 67, 6769, 16, 11788, 67, 6769, 16, 2834, 67, 2079, 4672, 26629, 273, 595, 18, 1612, 2673, 1435, 309, 2834, 67, 350, 316, 26629, 30, 309, ...
class LumieraConfigContext(SConfBase):
class LumieraConfigContext(ConfigBase):
# def AddMethod (self, function):
0ece037f9145b0c2a3465e7320836c6de6ee8187 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/13677/0ece037f9145b0c2a3465e7320836c6de6ee8187/LumieraEnvironment.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 282, 1652, 1436, 1305, 261, 2890, 16, 445, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 468, 282, 1652, 1436, 1305, 261, 2890, 16, 445, 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,...
:: Sage: I = Ideal([]) u nable to determine whi ch rin g to embed the ideal in
def Ideal(*args, **kwds): r""" Create the ideal in ring with given generators. There are some shorthand notations for creating an ideal, in addition to using the Ideal function:: -- R.ideal(gens, coerce=True) -- gens*R -- R*gens INPUT: - ``R (optional)`` - a ring (if not given, will try to infer it from gens) - ``gens`` - list of elements generating the ideal - ``coerce (optional)`` - bool (default: True); whether gens need to be coerced into ring. OUTPUT: The ideal of ring generated by gens. EXAMPLES:: sage: R, x = PolynomialRing(ZZ, 'x').objgen() sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2]) sage: I Ideal (x^2 + 3*x + 4, x^2 + 1) of Univariate Polynomial Ring in x over Integer Ring sage: Ideal(R, [4 + 3*x + x^2, 1 + x^2]) Ideal (x^2 + 3*x + 4, x^2 + 1) of Univariate Polynomial Ring in x over Integer Ring sage: Ideal((4 + 3*x + x^2, 1 + x^2)) Ideal (x^2 + 3*x + 4, x^2 + 1) of Univariate Polynomial Ring in x over Integer Ring :: sage: ideal(x^2-2*x+1, x^2-1) Ideal (x^2 - 2*x + 1, x^2 - 1) of Univariate Polynomial Ring in x over Integer Ring sage: ideal([x^2-2*x+1, x^2-1]) Ideal (x^2 - 2*x + 1, x^2 - 1) of Univariate Polynomial Ring in x over Integer Ring sage: l = [x^2-2*x+1, x^2-1] sage: ideal(f^2 for f in l) Ideal (x^4 - 4*x^3 + 6*x^2 - 4*x + 1, x^4 - 2*x^2 + 1) of Univariate Polynomial Ring in x over Integer Ring This example illustrates how Sage finds a common ambient ring for the ideal, even though 1 is in the integers (in this case). :: sage: R.<t> = ZZ['t'] sage: i = ideal(1,t,t^2) sage: i Ideal (1, t, t^2) of Univariate Polynomial Ring in t over Integer Ring sage: ideal(1/2,t,t^2) Principal ideal (1) of Univariate Polynomial Ring in t over Rational Field This shows that the issues at trac #1104 are resolved:: sage: Ideal(3, 5) Principal ideal (1) of Integer Ring sage: Ideal(ZZ, 3, 5) Principal ideal (1) of Integer Ring sage: Ideal(2, 4, 6) Principal ideal (2) of Integer Ring :: You have to provide enough information that Sage can figure out which ring to put the ideal in. sage: I = Ideal([]) Traceback (most recent call last): ... ValueError: unable to determine which ring to embed the ideal in sage: I = Ideal() Traceback (most recent call last): ... ValueError: need at least one argument TESTS:: sage: R, x = PolynomialRing(ZZ, 'x').objgen() sage: I = R.ideal([4 + 3*x + x^2, 1 + x^2]) sage: I == loads(dumps(I)) True :: sage: I = Ideal(R, [4 + 3*x + x^2, 1 + x^2]) sage: I == loads(dumps(I)) True :: sage: I = Ideal((4 + 3*x + x^2, 1 + x^2)) sage: I == loads(dumps(I)) True :: Sage: I = Ideal([]) u nable to determine whi ch rin g to embed the ideal in """ if len(args) == 0: raise ValueError, "need at least one argument" if len(args) == 1 and args[0] == []: raise ValueError, "unable to determine which ring to embed the ideal in" if kwds.has_key('coerce'): coerce = kwds['coerce'] else: coerce = True first = args[0] if not isinstance(first, sage.rings.ring.Ring): if isinstance(first, Ideal_generic): R = first.ring() gens = first.gens() else: gens = args if isinstance(first, (list, tuple, GeneratorType)): gens = first gens = Sequence(gens) R = gens.universe() if not isinstance(R, sage.rings.ring.Ring): raise TypeError, "unable to find common ring into which all ideal generators map" return R.ideal(gens) else: R = first gens = args[1:] if isinstance(gens[0], Ideal_generic): gens = gens[0].gens() elif isinstance(gens[0], (list, tuple)): gens = gens[0] if not commutative_ring.is_CommutativeRing(R): raise TypeError, "R must be a commutative ring" if len(gens) == 0: gens = [R(0)] coerce = False if coerce: gens = [R(g) for g in gens] if isinstance(R, sage.rings.principal_ideal_domain.PrincipalIdealDomain): # Use GCD algorithm to obtain a principal ideal g = gens[0] for h in gens[1:]: g = R.gcd(g, h) return Ideal_pid(R, g) if len(gens) == 1: return Ideal_principal(R, gens[0]) return Ideal_generic(R, gens, coerce=False)
9f527dbe184cebca429d19839cc14be0e0d0c38b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/9f527dbe184cebca429d19839cc14be0e0d0c38b/ideal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23062, 287, 30857, 1968, 16, 2826, 25577, 4672, 436, 8395, 1788, 326, 23349, 316, 9221, 598, 864, 13327, 18, 225, 6149, 854, 2690, 21310, 486, 1012, 364, 4979, 392, 23349, 16, 316, 2719, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23062, 287, 30857, 1968, 16, 2826, 25577, 4672, 436, 8395, 1788, 326, 23349, 316, 9221, 598, 864, 13327, 18, 225, 6149, 854, 2690, 21310, 486, 1012, 364, 4979, 392, 23349, 16, 316, 2719, ...
lineBreakPrev = False
def breakLines(self, width): """ Returns a broken line structure. There are two cases
48ed9650605c6220b00ca44c7bebae56c7a40cde /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/48ed9650605c6220b00ca44c7bebae56c7a40cde/paragraph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 898, 5763, 12, 2890, 16, 1835, 4672, 3536, 2860, 279, 12933, 980, 3695, 18, 6149, 854, 2795, 6088, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 898, 5763, 12, 2890, 16, 1835, 4672, 3536, 2860, 279, 12933, 980, 3695, 18, 6149, 854, 2795, 6088, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
colWidths = "cm,".join(map(str, cols_widhts))
colWidths = "cm,".join(map(tools.ustr, cols_widhts))
def create(self, cr, uid, ids, datas, context):
359c4ac3c3deec88d37b44f93123f5d4ba02f3b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7339/359c4ac3c3deec88d37b44f93123f5d4ba02f3b3/survey_form.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 5386, 16, 819, 4672, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 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, 752, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 5386, 16, 819, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
style=wx.ALIGN_CENTER_HORIZONTAL, label="%i x 10^%i" % (p,n)) box.Add(self.multiplier, 0, wx.EXPAND|wx.TOP, 10)
style=wx.ALIGN_CENTER_HORIZONTAL, label=lbl) self.iso_level_slider.Bind(wx.EVT_SCROLL, self.on_iso_level_changed) self.tools = wx.MiniFrame(self.frame, style=wx.CAPTION|wx.CLOSE_BOX) tools_nb = wx.Notebook(self.tools) opengl_page = wx.NotebookPage(tools_nb) tools_nb.AddPage(opengl_page, "Lighting and Materials") self.front_colour_picker = wx.lib.colourselect.ColourSelect(self.frame) self.back_colour_picker = wx.lib.colourselect.ColourSelect(self.frame) self.swap_colour_btn = wx.Button(self.frame, label="< swap >") self.wires_btn = wx.CheckBox(self.frame) self.wires_btn.Bind(wx.EVT_CHECKBOX, self.on_wires_changed) self.ambient_slider = wx.Slider(opengl_page, style=wx.SL_AUTOTICKS|wx.SL_LABELS) self.diffuse_slider = wx.Slider(opengl_page, style=wx.SL_AUTOTICKS|wx.SL_LABELS) self.specular_slider = wx.Slider(opengl_page, style=wx.SL_AUTOTICKS|wx.SL_LABELS) self.specular_focus_slider = wx.Slider(opengl_page, style=wx.SL_AUTOTICKS) self.material_ctrl = wx_controllers.material(view.material, self.front_colour_picker, self.back_colour_picker, self.swap_colour_btn, self.wires_btn, self.ambient_slider, self.diffuse_slider, self.specular_slider, self.specular_focus_slider, on_change=view.OnRedrawGL) box = wx.BoxSizer(wx.VERTICAL) box.Add(view, 1, wx.EXPAND|wx.ALL, 5) iso_level_slider_box = wx.BoxSizer(wx.VERTICAL) iso_level_slider_box.Add(self.iso_level_slider, 0, wx.ALL, 5) iso_level_slider_box.Add(self.multiplier, 0, wx.CENTER|wx.ALL, 5) iso_level_box = wx.BoxSizer(wx.HORIZONTAL) iso_level_box.Add(wx.StaticText(self.frame, label="Iso-level"), 0, wx.ALL, 5) iso_level_box.Add(iso_level_slider_box) box.Add(iso_level_box) box.AddSpacer(10) colour_box = wx.BoxSizer(wx.HORIZONTAL) colour_box.Add(wx.StaticText(self.frame, label="Front"), 0, wx.ALL, 5) colour_box.Add(self.front_colour_picker, 0, wx.ALL, 5) colour_box.Add(self.swap_colour_btn, 0, wx.ALL, 5) colour_box.Add(wx.StaticText(self.frame, label="Back"), 0, wx.ALL, 5) colour_box.Add(self.back_colour_picker, 0, wx.ALL, 5) colour_box.Add(wx.StaticText(self.frame, label="Wires"), 0, wx.ALL, 5) colour_box.Add(self.wires_btn, 0, wx.ALL, 5) box.Add(colour_box)
def init_view_objects(self): box = wx.BoxSizer(wx.VERTICAL) self.view_objects = map_view(fft_map=self.map, unit_cell=self.unit_cell, raw_map=self.raw_map, frame=self.frame, wires=self.wires, size=(700,800)) box.Add(self.view_objects, wx.EXPAND, wx.EXPAND)
7c5e2e9abbc0a0f9ae34009f899290df53499bb6 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/696/7c5e2e9abbc0a0f9ae34009f899290df53499bb6/wx_map_viewer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 1945, 67, 6911, 12, 2890, 4672, 3919, 273, 7075, 18, 3514, 20512, 12, 27226, 18, 21654, 10109, 13, 365, 18, 1945, 67, 6911, 273, 852, 67, 1945, 12, 25174, 67, 1458, 33, 2890,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 67, 1945, 67, 6911, 12, 2890, 4672, 3919, 273, 7075, 18, 3514, 20512, 12, 27226, 18, 21654, 10109, 13, 365, 18, 1945, 67, 6911, 273, 852, 67, 1945, 12, 25174, 67, 1458, 33, 2890,...
self.print_template_pattern = None self.template_exclusion_category = None self.template_blacklist = None
def got_coll_params(params): self.print_template_pattern = None self.template_exclusion_category = None self.template_blacklist = None self.__dict__.update(params) if template_exclusion_category: self.template_exclusion_category = template_exclusion_category
fd4b6c966220308e8bb38c2fabf81f99cf9fcb6c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12391/fd4b6c966220308e8bb38c2fabf81f99cf9fcb6c/fetch.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2363, 67, 12910, 67, 2010, 12, 2010, 4672, 225, 365, 16186, 1576, 25648, 2725, 12, 2010, 13, 309, 1542, 67, 338, 15335, 67, 4743, 30, 365, 18, 3202, 67, 338, 15335, 67, 4743, 273, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2363, 67, 12910, 67, 2010, 12, 2010, 4672, 225, 365, 16186, 1576, 25648, 2725, 12, 2010, 13, 309, 1542, 67, 338, 15335, 67, 4743, 30, 365, 18, 3202, 67, 338, 15335, 67, 4743, 273, 1542...
"""fail the test if C{first} is C{second}. This is an obect-identity-equality test, not an object equality (i.e. C{__eq__}) test
""" Fail the test if C{first} is C{second}. This is an obect-identity-equality test, not an object equality (i.e. C{__eq__}) test.
def failIfIdentical(self, first, second, msg=None): """fail the test if C{first} is C{second}. This is an obect-identity-equality test, not an object equality (i.e. C{__eq__}) test
434843ce198b9e23446e9e85eb5ec545f8834e3e /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12595/434843ce198b9e23446e9e85eb5ec545f8834e3e/unittest.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2321, 2047, 6106, 1706, 12, 2890, 16, 1122, 16, 2205, 16, 1234, 33, 7036, 4672, 3536, 6870, 326, 1842, 309, 385, 95, 3645, 97, 353, 385, 95, 8538, 5496, 1220, 353, 392, 3768, 386, 17, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2321, 2047, 6106, 1706, 12, 2890, 16, 1122, 16, 2205, 16, 1234, 33, 7036, 4672, 3536, 6870, 326, 1842, 309, 385, 95, 3645, 97, 353, 385, 95, 8538, 5496, 1220, 353, 392, 3768, 386, 17, ...
'this string is way way too long and should overflow onto the next line eventually if I keep typing for long enough'], [';just_any_old_semicolon-starting-string', 'a ball of string'])))
'this string is way way too long and should overflow onto the next line eventually if I keep typing for long enough', ';just_any_old_semicolon-starting-string'], ['a string with a final quote"', 'a string with a " and a safe\';', 'a string with a final \''])))
def setUp(self): """Write out a file, then read it in again""" # fill up the block with stuff items = (('_item_1','Some data'), ('_item_2','Some_underline_data'), ('_item_3','34.2332'), ('_item_4','Some very long data which we hope will overflow the single line and force printing of another line aaaaa bbbbbb cccccc dddddddd eeeeeeeee fffffffff hhhhhhhhh iiiiiiii jjjjjj'), (('_item_5','_item_6','_item_7'), ([1,2,3,4], [5,6,7,8], ['a','b','c','d'])), (('_string_1','_string_2'), ([';this string begins with a semicolon', 'this string is way way too long and should overflow onto the next line eventually if I keep typing for long enough'], [';just_any_old_semicolon-starting-string', 'a ball of string']))) self.cf = CifFile.CifBlock(items) cif = CifFile.CifFile() cif['testblock'] = self.cf outfile = open('test.cif','w') outfile.write(str(cif)) outfile.close() self.df = CifFile.CifFile('test.cif')['testblock']
1d23b04704fd21b75c00b97c8f18b8aaeb5cd718 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3057/1d23b04704fd21b75c00b97c8f18b8aaeb5cd718/TestPyCifRW.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 3536, 3067, 596, 279, 585, 16, 1508, 855, 518, 316, 3382, 8395, 468, 3636, 731, 326, 1203, 598, 10769, 1516, 273, 261, 2668, 67, 1726, 67, 21, 17023, 17358, 501, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 24292, 12, 2890, 4672, 3536, 3067, 596, 279, 585, 16, 1508, 855, 518, 316, 3382, 8395, 468, 3636, 731, 326, 1203, 598, 10769, 1516, 273, 261, 2668, 67, 1726, 67, 21, 17023, 17358, 501, ...
_("%s isn't subscribed to this list.") % mail.GetSender(), user, pluser)
_("%(origsender)s isn't subscribed to this list."), user, pluser)
def getval(key, default, form=form): if form.has_key(key): try: return int(form[key].value) except ValueError: return default return default
271131e22a67ced7cee6dcb6fb6840ce57b4190b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2120/271131e22a67ced7cee6dcb6fb6840ce57b4190b/handle_opts.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 1125, 12, 856, 16, 805, 16, 646, 33, 687, 4672, 309, 646, 18, 5332, 67, 856, 12, 856, 4672, 775, 30, 327, 509, 12, 687, 63, 856, 8009, 1132, 13, 1335, 2068, 30, 327, 805, 327,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 336, 1125, 12, 856, 16, 805, 16, 646, 33, 687, 4672, 309, 646, 18, 5332, 67, 856, 12, 856, 4672, 775, 30, 327, 509, 12, 687, 63, 856, 8009, 1132, 13, 1335, 2068, 30, 327, 805, 327,...
c.push("world\n") asyncore.loop() s.join() self.assertEqual(c.contents, 'hello world') def test_numeric_terminator(self):
c.push("world%s" % term) c.push("I'm not dead yet!%s" % term) c.push(SERVER_QUIT) asyncore.loop(use_poll=self.usepoll) s.join() self.assertEqual(c.contents, ["hello world", "I'm not dead yet!"]) def test_line_terminator1(self): for l in (1,2,3): self.line_terminator_check('\n', l) def test_line_terminator2(self): for l in (1,2,3): self.line_terminator_check('\r\n', l) def test_line_terminator3(self): for l in (1,2,3): self.line_terminator_check('qqq', l) def numeric_terminator_check(self, termlen):
def test_line_terminator(self): s = echo_server() s.start() time.sleep(1) # Give server time to initialize c = echo_client('\n') c.push("hello ") c.push("world\n") asyncore.loop() s.join()
ec62423be4a84a056a9a0a1203875b8a29279365 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/8546/ec62423be4a84a056a9a0a1203875b8a29279365/test_asynchat.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 1369, 67, 9505, 639, 12, 2890, 4672, 272, 273, 3376, 67, 3567, 1435, 272, 18, 1937, 1435, 813, 18, 19607, 12, 21, 13, 468, 22374, 1438, 813, 358, 4046, 276, 273, 3376, 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, 1842, 67, 1369, 67, 9505, 639, 12, 2890, 4672, 272, 273, 3376, 67, 3567, 1435, 272, 18, 1937, 1435, 813, 18, 19607, 12, 21, 13, 468, 22374, 1438, 813, 358, 4046, 276, 273, 3376, 67, ...
if parametric or polar:
if parametric:
def _plot(funcs, xrange, parametric=False, polar=False, fill=None, label='', randomize=True, **options): if not is_fast_float(funcs): funcs = fast_float(funcs, expect_one_var=True) #parametric_plot will be a list or tuple of two functions (f,g) #and will plotted as (f(x), g(x)) for all x in the given range if parametric: f, g = funcs #or we have only a single function to be plotted: else: f = funcs # xrange has to be either of the form (var, xmin, xmax) or (xmin, xmax) if not isinstance(xrange, (tuple, list)): raise TypeError, "xrange must be a tuple or list" if len(xrange) == 3: xmin, xmax = xrange[1], xrange[2] elif len(xrange) == 2: xmin, xmax = xrange[0], xrange[1] else: raise ValueError, "parametric value range must be a list or tuple of length 2 or 3." #check to see if funcs is a list of functions that will #be all plotted together. if isinstance(funcs, (list, tuple)) and not parametric: rainbow_colors = rainbow(len(funcs)) G = Graphics() for i, h in enumerate(funcs): if isinstance(fill, dict): if i in fill: fill_entry = fill[i] if isinstance(fill_entry, list): if fill_entry[0] < len(funcs): fill_temp = funcs[fill_entry[0]] else: fill_temp = None else: fill_temp = fill_entry else: fill_temp = None else: fill_temp = fill options_temp = options.copy() fillcolor_temp = options_temp.pop('fillcolor', 'automatic') if fillcolor_temp == 'automatic': fillcolor_temp = rainbow_colors[i] G += plot(h, (xmin, xmax), polar = polar, fill = fill_temp, \ fillcolor = fillcolor_temp, **options_temp) return G adaptive_tolerance = options.pop('adaptive_tolerance') adaptive_recursion = options.pop('adaptive_recursion') plot_points = int(options.pop('plot_points')) data = generate_plot_points(f, xrange, plot_points, adaptive_tolerance, adaptive_recursion, randomize) if parametric: data = [(fdata, g(x)) for x, fdata in data] G = Graphics() fillcolor = options.pop('fillcolor', 'automatic') fillalpha = options.pop('fillalpha', 0.5) # TODO: Use matplotlib's fill and fill_between commands. if fill is not None: if parametric or polar: filldata = data else: if fill == 'axis' or fill is True: base_level = 0 elif fill == 'min': base_level = min(t[1] for t in data) elif fill == 'max': base_level = max(t[1] for t in data) elif hasattr(fill, '__call__'): if fill == max or fill == min: if fill == max: fstr = 'max' else: fstr = 'min' msg = "WARNING: You use the built-in function %s for filling. You probably wanted the string '%s'." % (fstr, fstr) sage.misc.misc.verbose(msg, level=0) if not is_fast_float(fill): fill_f = fast_float(fill, expect_one_var=True) else: fill_f = fill filldata = generate_plot_points(fill_f, xrange, plot_points, adaptive_tolerance, \ adaptive_recursion, randomize) filldata.reverse() filldata += data else: try: base_level = float(fill) except TypeError: base_level = 0 if not hasattr(fill, '__call__') and polar: filldata = generate_plot_points(lambda x: base_level, xrange, plot_points, adaptive_tolerance, \ adaptive_recursion, randomize) filldata.reverse() filldata += data if not hasattr(fill, '__call__') and not polar: filldata = [(data[0][0], base_level)] + data + [(data[-1][0], base_level)] if fillcolor == 'automatic': fillcolor = (0.5, 0.5, 0.5) fill_options = {} fill_options['rgbcolor'] = fillcolor fill_options['alpha'] = fillalpha fill_options['thickness'] = 0 if polar: filldata = [(y*cos(x), y*sin(x)) for x, y in filldata] G += polygon(filldata, **fill_options) if polar: data = [(y*cos(x), y*sin(x)) for x, y in data] from sage.plot.all import line, text detect_poles = options.pop('detect_poles', False) if not (polar or parametric) and detect_poles != False: from sage.rings.all import RDF epsilon = 0.0001 startIndex = 0 pole_options = {} pole_options['linestyle'] = '--' pole_options['thickness'] = 1 pole_options['rgbcolor'] = '#ccc' for i in range(len(data)-1): x0, y0 = data[i] x1, y1 = data[i+1] if (y1 > 0 and y0 < 0) or (y1 < 0 and y0 > 0): # calculate the slope of the line segment dy = abs(y1-y0) dx = x1 - x0 alpha = (RDF(dy)/RDF(dx)).arctan() if alpha >= RDF(pi/2) - epsilon: G += line(data[startIndex:i], **options) if detect_poles == 'show': # draw a vertical asymptote G += line([(x0, y0), (x1, y1)], **pole_options) startIndex = i+2 G += line(data[startIndex:], **options) else: G += line(data, **options) # Label? if label: label = ' '+str(label) G += text(label, data[-1], horizontal_alignment='left', vertical_alignment='center') return G
9714ef8646ca9063d92ec238bb616e82908e9fb1 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/9714ef8646ca9063d92ec238bb616e82908e9fb1/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 4032, 12, 17728, 16, 12314, 16, 579, 1591, 33, 8381, 16, 24244, 33, 8381, 16, 3636, 33, 7036, 16, 1433, 2218, 2187, 2744, 554, 33, 5510, 16, 2826, 2116, 4672, 309, 486, 353, 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, 389, 4032, 12, 17728, 16, 12314, 16, 579, 1591, 33, 8381, 16, 24244, 33, 8381, 16, 3636, 33, 7036, 16, 1433, 2218, 2187, 2744, 554, 33, 5510, 16, 2826, 2116, 4672, 309, 486, 353, 67, ...
labelCustomTitle=Label(frameCustom,text='Set Custom Key Bindings')
def CreatePageKeys(self): #tkVars self.bindingTarget=StringVar(self) self.builtinKeys=StringVar(self) self.customKeys=StringVar(self) self.keysAreBuiltin=BooleanVar(self) self.keyBinding=StringVar(self) ##widget creation #body frame frame=self.tabPages.pages['Keys']['page'] #body section frames frameCustom=Frame(frame,borderwidth=2,relief=GROOVE) frameKeySets=Frame(frame,borderwidth=2,relief=GROOVE) #frameCustom frameTarget=Frame(frameCustom) labelCustomTitle=Label(frameCustom,text='Set Custom Key Bindings') labelTargetTitle=Label(frameTarget,text='Action - Key(s)') scrollTargetY=Scrollbar(frameTarget) scrollTargetX=Scrollbar(frameTarget,orient=HORIZONTAL) self.listBindings=Listbox(frameTarget,takefocus=FALSE, exportselection=FALSE) self.listBindings.bind('<ButtonRelease-1>',self.KeyBindingSelected) scrollTargetY.config(command=self.listBindings.yview) scrollTargetX.config(command=self.listBindings.xview) self.listBindings.config(yscrollcommand=scrollTargetY.set) self.listBindings.config(xscrollcommand=scrollTargetX.set) self.buttonNewKeys=Button(frameCustom,text='Get New Keys for Selection', command=self.GetNewKeys,state=DISABLED) buttonSaveCustomKeys=Button(frameCustom, text='Save as New Custom Key Set',command=self.SaveAsNewKeySet) #frameKeySets labelKeysTitle=Label(frameKeySets,text='Select a Key Set') labelTypeTitle=Label(frameKeySets,text='Select : ') self.radioKeysBuiltin=Radiobutton(frameKeySets,variable=self.keysAreBuiltin, value=1,command=self.SetKeysType,text='a Built-in Key Set') self.radioKeysCustom=Radiobutton(frameKeySets,variable=self.keysAreBuiltin, value=0,command=self.SetKeysType,text='a Custom Key Set') self.optMenuKeysBuiltin=DynOptionMenu(frameKeySets, self.builtinKeys,None,command=None) self.optMenuKeysCustom=DynOptionMenu(frameKeySets, self.customKeys,None,command=None) self.buttonDeleteCustomKeys=Button(frameKeySets,text='Delete Custom Key Set', command=self.DeleteCustomKeys) ##widget packing #body frameCustom.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH) frameKeySets.pack(side=LEFT,padx=5,pady=5,fill=Y) #frameCustom labelCustomTitle.pack(side=TOP,anchor=W,padx=5,pady=5) buttonSaveCustomKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5) self.buttonNewKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5) frameTarget.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH) #frame target frameTarget.columnconfigure(0,weight=1) frameTarget.rowconfigure(1,weight=1) labelTargetTitle.grid(row=0,column=0,columnspan=2,sticky=W) self.listBindings.grid(row=1,column=0,sticky=NSEW) scrollTargetY.grid(row=1,column=1,sticky=NS) scrollTargetX.grid(row=2,column=0,sticky=EW) #frameKeySets labelKeysTitle.pack(side=TOP,anchor=W,padx=5,pady=5) labelTypeTitle.pack(side=TOP,anchor=W,padx=5,pady=5) self.radioKeysBuiltin.pack(side=TOP,anchor=W,padx=5) self.radioKeysCustom.pack(side=TOP,anchor=W,padx=5,pady=2) self.optMenuKeysBuiltin.pack(side=TOP,fill=X,padx=5,pady=5) self.optMenuKeysCustom.pack(side=TOP,fill=X,anchor=W,padx=5,pady=5) self.buttonDeleteCustomKeys.pack(side=TOP,fill=X,padx=5,pady=5) return frame
ed15565253c2cb817c68ed89e22c7a6c7707ab66 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12029/ed15565253c2cb817c68ed89e22c7a6c7707ab66/configDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1788, 1964, 2396, 12, 2890, 4672, 468, 16099, 5555, 365, 18, 7374, 2326, 33, 780, 1537, 12, 2890, 13, 365, 18, 24553, 2396, 33, 780, 1537, 12, 2890, 13, 365, 18, 3662, 2396, 33, 780, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1788, 1964, 2396, 12, 2890, 4672, 468, 16099, 5555, 365, 18, 7374, 2326, 33, 780, 1537, 12, 2890, 13, 365, 18, 24553, 2396, 33, 780, 1537, 12, 2890, 13, 365, 18, 3662, 2396, 33, 780, ...
elif plot_type=='hist':
elif plot_type=='hist_logTransformed':
def savePlots(self, session, input_dir, call_method_id): """ 2009-2-17 """ files = os.listdir(input_dir) sys.stderr.write("Saving plots: %d files to be processed ...\n"%len(files)) files.sort() #in phenotype_method_id order as phenotype_method_id is the first character of each file. pheno_entry = None call_phen_entry = None prev_phenotype_method_id = None for i in range(len(files)): fname = files[i] sys.stderr.write("%d/%d:\t%s\n"%(i+1,len(files),fname)) re_search_result = self.re_plotfname.search(fname) pheno_hist_in_db = 0 call_phen_in_db = 0 if re_search_result: phenotype_method_id, plot_type = re_search_result.groups() phenotype_method_id = int(phenotype_method_id) #check if it's in db or not pheno_query = Stock_250kDB.PhenotypeHistPlots.query.filter_by(phenotype_method_id=phenotype_method_id).all() call_phen_query = Stock_250kDB.CallPhenotypeQQPlots.query.filter_by(phenotype_method_id=phenotype_method_id).filter_by(call_method_id=call_method_id).all() if pheno_query and call_phen_query: continue elif pheno_query: pheno_hist_in_db = 1 elif call_phen_query: call_phen_in_db = 1 if prev_phenotype_method_id==None: pheno_entry = Stock_250kDB.PhenotypeHistPlots(phenotype_method_id=phenotype_method_id) call_phen_entry = Stock_250kDB.CallPhenotypeQQPlots(phenotype_method_id=phenotype_method_id, call_method_id=call_method_id) prev_phenotype_method_id = phenotype_method_id elif prev_phenotype_method_id!=phenotype_method_id: #different phenotype here if pheno_entry: if not pheno_hist_in_db: session.save_or_update(pheno_entry) pheno_entry = None pheno_entry = Stock_250kDB.PhenotypeHistPlots(phenotype_method_id=phenotype_method_id) if call_phen_entry: if not call_phen_in_db: session.save_or_update(call_phen_entry) call_phen_entry = None call_phen_entry = Stock_250kDB.CallPhenotypeQQPlots(phenotype_method_id=phenotype_method_id, call_method_id=call_method_id) prev_phenotype_method_id = phenotype_method_id img = self.getImageFromFile(input_dir, fname) if plot_type=='qqplot': call_phen_entry.qq_thumb = img.thumb_data call_phen_entry.qq_plot = img.data call_phen_entry.qq_plot_fname = img.filename elif plot_type=='qqplot_log': call_phen_entry.qq_log_thumb = img.thumb_data call_phen_entry.qq_log_plot = img.data elif plot_type=='hist_logTransformed': pheno_entry.hist_thumb = img.thumb_data pheno_entry.hist_plot = img.data pheno_entry.hist_plot_fname = img.filename elif plot_type=='hist': pheno_entry.hist_log_thumb = img.thumb_data pheno_entry.hist_log_plot = img.data #don't forget the last file if it contains plot we want if pheno_entry: session.save_or_update(pheno_entry) if call_phen_entry: session.save_or_update(call_phen_entry) sys.stderr.write("Done.\n")
253069bd1465558b0452098a93e49c7f321a4769 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9645/253069bd1465558b0452098a93e49c7f321a4769/PutPhenotypeHistAndQQPlotsIntoDB.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 29311, 12, 2890, 16, 1339, 16, 810, 67, 1214, 16, 745, 67, 2039, 67, 350, 4672, 3536, 4044, 29, 17, 22, 17, 4033, 3536, 1390, 273, 1140, 18, 1098, 1214, 12, 2630, 67, 1214, 13,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1923, 29311, 12, 2890, 16, 1339, 16, 810, 67, 1214, 16, 745, 67, 2039, 67, 350, 4672, 3536, 4044, 29, 17, 22, 17, 4033, 3536, 1390, 273, 1140, 18, 1098, 1214, 12, 2630, 67, 1214, 13,...
except socket.herror:
except socket.error:
def __init__(self, addr, num):
38bf3584d1a7e9875b596762942d7f25db423cb1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3643/38bf3584d1a7e9875b596762942d7f25db423cb1/pinger.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 3091, 16, 818, 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, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 3091, 16, 818, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return p_simple_statement_list(s)
return p_simple_statement_list(s, level)
s.error('def statement not allowed here')
fc589a48ae9f92ecd3ddf76e0182925bb7afa4a0 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/2099/fc589a48ae9f92ecd3ddf76e0182925bb7afa4a0/Parsing.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 272, 18, 1636, 2668, 536, 3021, 486, 2935, 2674, 6134, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 272, 18, 1636, 2668, 536, 3021, 486, 2935, 2674, 6134, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True ), 'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True ), 'lot_output_id': fields.many2one('stock.location', 'Location Output', required=True ), }
'lot_input_id': fields.many2one('stock.location', 'Location Input', required=True), 'lot_stock_id': fields.many2one('stock.location', 'Location Stock', required=True), 'lot_output_id': fields.many2one('stock.location', 'Location Output', required=True), }
def on_change_product_id(self, cr, uid, ids, location_id, product, uom=False): if not product: return {} if not uom: prod = self.pool.get('product.product').browse(cr, uid, [product], {'uom': uom})[0] uom = prod.uom_id.id amount=self.pool.get('stock.location')._product_get(cr, uid, location_id, [product], {'uom': uom})[product] result = {'product_qty':amount, 'product_uom':uom} return {'value':result}
369221b47101072e094ad2d02fe2edd2b47690aa /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/7397/369221b47101072e094ad2d02fe2edd2b47690aa/stock.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 603, 67, 3427, 67, 5896, 67, 350, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 2117, 67, 350, 16, 3017, 16, 582, 362, 33, 8381, 4672, 309, 486, 3017, 30, 327, 2618, 309, 486, 582, 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, 603, 67, 3427, 67, 5896, 67, 350, 12, 2890, 16, 4422, 16, 4555, 16, 3258, 16, 2117, 67, 350, 16, 3017, 16, 582, 362, 33, 8381, 4672, 309, 486, 3017, 30, 327, 2618, 309, 486, 582, 3...
message.ack()
def execute_next_task(self): task, message = self.fetch_next_task()
b935d461b7db03aa2e39828777550ee862568ab2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2024/b935d461b7db03aa2e39828777550ee862568ab2/worker.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1836, 67, 4285, 67, 4146, 12, 2890, 4672, 1562, 16, 883, 273, 365, 18, 5754, 67, 4285, 67, 4146, 1435, 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, 1836, 67, 4285, 67, 4146, 12, 2890, 4672, 1562, 16, 883, 273, 365, 18, 5754, 67, 4285, 67, 4146, 1435, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
'SHLINKFLAGS' : 'ldflags',
def GenerateConfig(fp, config, indent='', src_dir=''): """ Generates SCons dictionary items for a gyp configuration. This provides the main translation between the (lower-case) gyp settings keywords and the (upper-case) SCons construction variables. """ var_mapping = { 'ASFLAGS' : 'asflags', 'CCFLAGS' : 'cflags', 'CFLAGS' : 'cflags_c', 'CXXFLAGS' : 'cflags_cc', 'CPPDEFINES' : 'defines', 'CPPPATH' : 'include_dirs', 'LINKFLAGS' : 'ldflags', 'SHLINKFLAGS' : 'ldflags', } postamble='\n%s],\n' % indent for scons_var in sorted(var_mapping.keys()): gyp_var = var_mapping[scons_var] value = config.get(gyp_var) if value: if gyp_var in ('defines',): value = [escape_quotes(v) for v in value] if gyp_var in ('include_dirs',): if src_dir and not src_dir.endswith('/'): src_dir += '/' result = [] for v in value: v = FixPath(v, src_dir) # Force SCons to evaluate the CPPPATH directories at # SConscript-read time, so delayed evaluation of $SRC_DIR # doesn't point it to the --generator-output= directory. result.append('env.Dir(%r)' % v) value = result else: value = map(repr, value) WriteList(fp, value, prefix=indent, preamble='%s%s = [\n ' % (indent, scons_var), postamble=postamble)
481fdc07abe24cd84e81968bb9d60b4d4a83ab8a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6220/481fdc07abe24cd84e81968bb9d60b4d4a83ab8a/scons.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 809, 12, 7944, 16, 642, 16, 3504, 2218, 2187, 1705, 67, 1214, 2218, 11, 4672, 3536, 31902, 20487, 3880, 1516, 364, 279, 314, 879, 1664, 18, 225, 1220, 8121, 326, 2774, 4794, 3086, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6654, 809, 12, 7944, 16, 642, 16, 3504, 2218, 2187, 1705, 67, 1214, 2218, 11, 4672, 3536, 31902, 20487, 3880, 1516, 364, 279, 314, 879, 1664, 18, 225, 1220, 8121, 326, 2774, 4794, 3086, ...
raise ValueError("invalid type of node object: %s", ltype)
raise ValueError("invalid type of node object: %s" % (ltype,))
def _checkAttributes(self, node): """_checkAttributes(node) -> None. Checks file node-specific attributes.
510280e4d3d3d19e69c6e84a904db893de1fec21 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12687/510280e4d3d3d19e69c6e84a904db893de1fec21/FileNode.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 2498, 12, 2890, 16, 756, 4672, 3536, 67, 1893, 2498, 12, 2159, 13, 317, 599, 18, 225, 13074, 585, 756, 17, 12524, 1677, 18, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 2498, 12, 2890, 16, 756, 4672, 3536, 67, 1893, 2498, 12, 2159, 13, 317, 599, 18, 225, 13074, 585, 756, 17, 12524, 1677, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100...
rule = dict(cp.items(name))
rule = {} for key in cp.options(name): rule[key] = cp.get(name, key)
def read_ini (self, filename): """ Read a set of rules from a file. See the texinfo documentation for the expected format of this file. """ from ConfigParser import ConfigParser cp = ConfigParser() cp.read(filename) for name in cp.sections(): rule = dict(cp.items(name)) rule["cost"] = cost = cp.getint(name, "cost") expr = re.compile(rule["target"] + "$") self.rules[name] = (expr, cost, rule)
7d7356346aacb262a555c7c9fae658cfd6d010b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10102/7d7356346aacb262a555c7c9fae658cfd6d010b8/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 855, 67, 8767, 261, 2890, 16, 1544, 4672, 3536, 2720, 279, 444, 434, 2931, 628, 279, 585, 18, 2164, 326, 16573, 1376, 7323, 364, 326, 2665, 740, 434, 333, 585, 18, 3536, 628, 25076, 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, 855, 67, 8767, 261, 2890, 16, 1544, 4672, 3536, 2720, 279, 444, 434, 2931, 628, 279, 585, 18, 2164, 326, 16573, 1376, 7323, 364, 326, 2665, 740, 434, 333, 585, 18, 3536, 628, 25076, 19...
else
else:
def __init__(data = None) if data == None: quickfix.StringField.__init__(self, 617) else quickfix.StringField.__init__(self, 617, 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, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1666, 4033, 13, 469, 30, 9549, 904, 18, 780, 974, 16186, 2738...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 780, 974, 16186, 2738, 972, 12, 2890, 16, 1666, 4033, 13, 469, 30, 9549, 904, 18, 780, 974, 16186, 2738...
'initial value %r' % (maxcount,))
'initial value %r' % self.maxcount
def v(self): self.nonzero.acquire() if self.count == self.maxcount: raise ValueError, '.v() tried to raise semaphore count above ' \ 'initial value %r' % (maxcount,)) self.count = self.count + 1 self.nonzero.signal() self.nonzero.release()
09659fbe690adf6d022daed7d02016b8ff756d41 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/09659fbe690adf6d022daed7d02016b8ff756d41/sync.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 331, 12, 2890, 4672, 365, 18, 26449, 18, 1077, 1039, 1435, 309, 365, 18, 1883, 422, 365, 18, 1896, 1883, 30, 1002, 2068, 16, 2418, 90, 1435, 12928, 358, 1002, 28921, 1056, 5721, 296, 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, 331, 12, 2890, 4672, 365, 18, 26449, 18, 1077, 1039, 1435, 309, 365, 18, 1883, 422, 365, 18, 1896, 1883, 30, 1002, 2068, 16, 2418, 90, 1435, 12928, 358, 1002, 28921, 1056, 5721, 296, 5...
def __init__(self,parentWidget = None, graph = None):
def __init__(self, parentWidget = None, graph = None):
def __init__(self,parentWidget = None, graph = None): OWBaseWidget.__init__(self, None, "Cluster Dialog")
509fd7bce11b383105f28fc76c9cd97530e78262 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6366/509fd7bce11b383105f28fc76c9cd97530e78262/OWClusterOptimization.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 4609, 273, 599, 16, 2667, 273, 599, 4672, 18233, 2171, 4609, 16186, 2738, 972, 12, 2890, 16, 599, 16, 315, 3629, 17242, 7923, 2, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 982, 4609, 273, 599, 16, 2667, 273, 599, 4672, 18233, 2171, 4609, 16186, 2738, 972, 12, 2890, 16, 599, 16, 315, 3629, 17242, 7923, 2, -100, -100, -100, -...
self.body = appuifw.Listbox([(u"empty", u"empty")], self.go_to)
self.body = self.create_listbox([(u"empty", u"empty")], self.go_to)
def __init__(self, player_ui, navigator, service_locator): Window.__init__(self, player_ui, navigator) self.__music_history_repository = service_locator.history_repository self.body = appuifw.Listbox([(u"empty", u"empty")], self.go_to) self.menu = self.get_menu_items()
43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5169/43a0f8d3d71fafa93f66b7de5c6311692b8b2ccd/aspyplayer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 7291, 67, 4881, 16, 19796, 16, 1156, 67, 20048, 4672, 6076, 16186, 2738, 972, 12, 2890, 16, 7291, 67, 4881, 16, 19796, 13, 365, 16186, 81, 14894, 67, 818...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7291, 67, 4881, 16, 19796, 16, 1156, 67, 20048, 4672, 6076, 16186, 2738, 972, 12, 2890, 16, 7291, 67, 4881, 16, 19796, 13, 365, 16186, 81, 14894, 67, 818...
for x in [0, 1,-1, 1e10, 1e20, 'inf', 'nan', '-inf'] :
for x in [0, 1,-1, 1e20, 'inf', 'nan', '-inf'] :
def check_float_type_print(tp): for x in [0, 1,-1, 1e10, 1e20, 'inf', 'nan', '-inf'] : _test_redirected_print(float(x), tp)
31b6cdf83b48b7f6d7ee86f341bf7ed47b6d4a29 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/14925/31b6cdf83b48b7f6d7ee86f341bf7ed47b6d4a29/test_print.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 5659, 67, 723, 67, 1188, 12, 6834, 4672, 364, 619, 316, 306, 20, 16, 404, 16, 17, 21, 16, 404, 73, 3462, 16, 296, 10625, 2187, 296, 13569, 2187, 2400, 10625, 3546, 294, 389,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 5659, 67, 723, 67, 1188, 12, 6834, 4672, 364, 619, 316, 306, 20, 16, 404, 16, 17, 21, 16, 404, 73, 3462, 16, 296, 10625, 2187, 296, 13569, 2187, 2400, 10625, 3546, 294, 389,...
cr.execute('select id from '+table._table+' where '+args[i][0]+' '+args[i][1]+' %s', (args[i][2],))
cr.execute('select id from "'+table._table+'" where "'+args[i][0]+'" '+args[i][1]+' %s', (args[i][2],))
def _rec_get(ids, table, parent): if not ids: return [] ids2 = table.search(cr, user, [(parent, 'in', ids)], context=context) return ids + _rec_get(ids2, table, parent)
be2ceb24bde4a569bfb092c4888d20f47c553384 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12853/be2ceb24bde4a569bfb092c4888d20f47c553384/orm.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3927, 67, 588, 12, 2232, 16, 1014, 16, 982, 4672, 309, 486, 3258, 30, 327, 5378, 3258, 22, 273, 1014, 18, 3072, 12, 3353, 16, 729, 16, 306, 12, 2938, 16, 296, 267, 2187, 3258, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 3927, 67, 588, 12, 2232, 16, 1014, 16, 982, 4672, 309, 486, 3258, 30, 327, 5378, 3258, 22, 273, 1014, 18, 3072, 12, 3353, 16, 729, 16, 306, 12, 2938, 16, 296, 267, 2187, 3258, ...
for i in make.parse_inc_src(f_inc_src_content, 5): f_inc.write(i) f_inc.write("\n") for i in make.parse_inc_src(f_inc_src_content, 3): if i.strip() == '': pass elif i[:2] == "//": f_inc.write(i) f_inc.write("\n") elif i[:1] == "(": f_inc.write(f_inc_src_mainmacro[0]) f_inc.write(i) f_inc.write("\n
f_inc.write("\n\n") f_inc.close() for i in make.parse_inc_src(content, 1): f_3dpack.write(i) f_3dpack.write("\n") macros = [] for i in make.parse_inc_src(content, 3): if i.strip() == '' or i[:2] == "//" or i[:1] == "(": pass else: i_split = i.split('(') if len(i_split)>1: i_split[1] = i_split[1].strip() if i_split[1] == ')': i_split = i_split[:-1]
def create(): make.clean()
9e249a6dacfafcde61ac83d5cd8becc030ac159f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/13644/9e249a6dacfafcde61ac83d5cd8becc030ac159f/eagle3d.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 13332, 1221, 18, 6200, 1435, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 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, 752, 13332, 1221, 18, 6200, 1435, 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, -...