rem stringlengths 2 226k | add stringlengths 0 227k | context stringlengths 8 228k | meta stringlengths 156 215 | input_ids list | attention_mask list | labels list |
|---|---|---|---|---|---|---|
self.status_msg("error: offset too close to straight down, picking down/out circle") | if emit_messages: self.status_msg("error: offset too close to straight down, picking down/out circle") | def update_ring_geometry(self): #bruce 070928 split this out of want_center_and_quat """ Recompute and set ring geometry attributes of self, namely self.circle_center, self.axis_dir, self.radius_vec, which depend on self.basemol, self.circle_n, and self.offset, and are used by self.want_center_and_quat(...) and by some debug drawing code. """ #e We store self.o.down (etc) when we enter the mode... # now we pick a circle in plane of that and current offset. # If this is ambiguous, we favor a circle in plane of initial down and out. | 46c7cf6276597b19e7c25d9e2ee2416dc85b5ea6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11221/46c7cf6276597b19e7c25d9e2ee2416dc85b5ea6/extrudeMode.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
8022,
67,
14330,
12,
2890,
4672,
468,
2848,
3965,
10934,
5908,
6030,
1416,
333,
596,
434,
2545,
67,
5693,
67,
464,
67,
372,
270,
3536,
868,
9200,
471,
444,
9221,
5316,
1677,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
8022,
67,
14330,
12,
2890,
4672,
468,
2848,
3965,
10934,
5908,
6030,
1416,
333,
596,
434,
2545,
67,
5693,
67,
464,
67,
372,
270,
3536,
868,
9200,
471,
444,
9221,
5316,
1677,
... |
return parsed_docstring.to_html(linker, indent=indent).strip() | descr = parsed_docstring.to_html(linker, indent=indent).strip() if descr == '': return ' ' return descr | def description(self, parsed_docstring, where=None, indent=0): assert isinstance(where, (APIDoc, type(None))) if parsed_docstring in (None, UNKNOWN): return '' linker = _HTMLDocstringLinker(self, where) return parsed_docstring.to_html(linker, indent=indent).strip() | 2e826daab46d77983d35e6a38ceacf1289828f6b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3512/2e826daab46d77983d35e6a38ceacf1289828f6b/html.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2477,
12,
2890,
16,
2707,
67,
24675,
16,
1625,
33,
7036,
16,
3504,
33,
20,
4672,
1815,
1549,
12,
6051,
16,
261,
2203,
734,
504,
16,
618,
12,
7036,
20349,
309,
2707,
67,
24675,
316,
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,
2477,
12,
2890,
16,
2707,
67,
24675,
16,
1625,
33,
7036,
16,
3504,
33,
20,
4672,
1815,
1549,
12,
6051,
16,
261,
2203,
734,
504,
16,
618,
12,
7036,
20349,
309,
2707,
67,
24675,
316,
2... |
return FiniteField_ext_pariElement(self.__parent, self.__value) | return FiniteField_ext_pariElement(self.__parent, self.__value, check=False) | def copy(self): """ Return a copy of this element. | 15cbf070b9af1ea36fb697f2325030f848348911 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/15cbf070b9af1ea36fb697f2325030f848348911/finite_field_element.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2000,
279,
1610,
434,
333,
930,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1610,
12,
2890,
4672,
3536,
2000,
279,
1610,
434,
333,
930,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.w.setdocfolderbutton = W.Button((10, -30, 80, 16), "Set doc folder", self.setdocpath) | self.w.setdocfolderbutton = W.Button((10, -30, 100, 16), "Set doc folder", self.setdocpath) | def __init__(self): prefs = MacPrefs.GetPrefs(W.getapplication().preffilepath) try: (docpath, kind, case, word, tut, lib, ref, ext, api) = prefs.docsearchengine except: (docpath, kind, case, word, tut, lib, ref, ext, api) = prefs.docsearchengine = \ ("", 0, 0, 0, 1, 1, 0, 0, 0) if docpath and not verifydocpath(docpath): docpath = "" self.w = W.Window((400, 200), "Search the Python Documentation") self.w.searchtext = W.EditText((10, 10, -100, 20), callback = self.checkbuttons) self.w.searchbutton = W.Button((-90, 12, 80, 16), "Search", self.search) buttons = [] gutter = 10 width = 130 bookstart = width + 2 * gutter self.w.phraseradio = W.RadioButton((10, 38, width, 16), "As a phrase", buttons) self.w.allwordsradio = W.RadioButton((10, 58, width, 16), "All words", buttons) self.w.anywordsradio = W.RadioButton((10, 78, width, 16), "Any word", buttons) self.w.casesens = W.CheckBox((10, 98, width, 16), "Case sensitive") self.w.wholewords = W.CheckBox((10, 118, width, 16), "Whole words") self.w.tutorial = W.CheckBox((bookstart, 38, -10, 16), "Tutorial") self.w.library = W.CheckBox((bookstart, 58, -10, 16), "Library reference") self.w.langueref = W.CheckBox((bookstart, 78, -10, 16), "Lanuage reference manual") self.w.extending = W.CheckBox((bookstart, 98, -10, 16), "Extending & embedding") self.w.api = W.CheckBox((bookstart, 118, -10, 16), "C/C++ API") self.w.setdocfolderbutton = W.Button((10, -30, 80, 16), "Set doc folder", self.setdocpath) if docpath: self.w.setdefaultbutton(self.w.searchbutton) else: self.w.setdefaultbutton(self.w.setdocfolderbutton) self.docpath = docpath if not docpath: docpath = "(please select the Python html documentation folder)" self.w.docfolder = W.TextBox((100, -28, -10, 16), docpath) [self.w.phraseradio, self.w.allwordsradio, self.w.anywordsradio][kind].set(1) self.w.casesens.set(case) self.w.wholewords.set(word) self.w.tutorial.set(tut) self.w.library.set(lib) self.w.langueref.set(ref) self.w.extending.set(ext) self.w.api.set(api) self.w.open() self.w.wholewords.enable(0) self.w.bind('<close>', self.close) self.w.searchbutton.enable(0) | c4637cd08a9bbc96efb42cb813b77be74b9dae66 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/c4637cd08a9bbc96efb42cb813b77be74b9dae66/PyDocSearch.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
15503,
273,
13217,
1386,
2556,
18,
967,
1386,
2556,
12,
59,
18,
588,
3685,
7675,
25724,
10561,
13,
775,
30,
261,
2434,
803,
16,
3846,
16,
648,
16,
2076... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
15503,
273,
13217,
1386,
2556,
18,
967,
1386,
2556,
12,
59,
18,
588,
3685,
7675,
25724,
10561,
13,
775,
30,
261,
2434,
803,
16,
3846,
16,
648,
16,
2076... |
gen = pagegenerators.PreloadingGenerator(gen, pageNumber = 240) | pageNumber = max(240, config.max_external_links * 2) gen = pagegenerators.PreloadingGenerator(gen, pageNumber = pageNumber) | def main(): gen = None singlePageTitle = [] # Which namespaces should be processed? # default to [] which means all namespaces will be processed namespaces = [] # This factory is responsible for processing command line arguments # that are also used by other scripts and that determine on which pages # to work on. genFactory = pagegenerators.GeneratorFactory() for arg in wikipedia.handleArgs(): if arg == '-talk': config.report_dead_links_on_talk = True elif arg == '-notalk': config.report_dead_links_on_talk = False elif arg.startswith('-namespace:'): try: namespaces.append(int(arg[11:])) except ValueError: namespaces.append(arg[11:]) elif arg == '-repeat': gen = RepeatPageGenerator() else: generator = genFactory.handleArg(arg) if generator: gen = generator else: singlePageTitle.append(arg) if singlePageTitle: singlePageTitle = ' '.join(singlePageTitle) page = wikipedia.Page(wikipedia.getSite(), singlePageTitle) gen = iter([page]) if gen: if namespaces != []: gen = pagegenerators.NamespaceFilterPageGenerator(gen, namespaces) gen = pagegenerators.PreloadingGenerator(gen, pageNumber = 240) gen = pagegenerators.RedirectFilterPageGenerator(gen) bot = WeblinkCheckerRobot(gen) try: bot.run() finally: waitTime = 0 # Don't wait longer than 30 seconds for threads to finish. while countLinkCheckThreads() > 0 and waitTime < 30: try: wikipedia.output(u"Waiting for remaining %i threads to finish, please wait..." % countLinkCheckThreads()) # wait 1 second time.sleep(1) waitTime += 1 except KeyboardInterrupt: wikipedia.output(u'Interrupted.') break if countLinkCheckThreads() > 0: wikipedia.output(u'Remaining %i threads will be killed.' % countLinkCheckThreads()) # Threads will die automatically because they are daemonic. if bot.history.reportThread: bot.history.reportThread.shutdown() # wait until the report thread is shut down; the user can interrupt # it by pressing CTRL-C. try: while bot.history.reportThread.isAlive(): time.sleep(0.1) except KeyboardInterrupt: wikipedia.output(u'Report thread interrupted.') bot.history.reportThread.kill() wikipedia.output(u'Saving history...') bot.history.save() else: wikipedia.showHelp() | 17eb2ff32a4c04a3d7fa138c6d2bcf67b3ebf0a8 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/17eb2ff32a4c04a3d7fa138c6d2bcf67b3ebf0a8/weblinkchecker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3157,
273,
599,
2202,
1964,
4247,
273,
5378,
468,
21918,
7728,
1410,
506,
5204,
35,
468,
805,
358,
5378,
1492,
4696,
777,
7728,
903,
506,
5204,
7728,
273,
5378,
468,
1220,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
3157,
273,
599,
2202,
1964,
4247,
273,
5378,
468,
21918,
7728,
1410,
506,
5204,
35,
468,
805,
358,
5378,
1492,
4696,
777,
7728,
903,
506,
5204,
7728,
273,
5378,
468,
1220,
3... |
""" | This method may raise the following exceptions: SMTPHeloError The server didn't reply properly to the helo greeting. """ self.ehlo_or_helo_if_needed() if not self.has_extn("starttls"): raise SMTPException("STARTTLS extension not supported by server.") | def starttls(self, keyfile = None, certfile = None): """Puts the connection to the SMTP server into TLS mode. | 3ffea9dac003dde41d355f74c7c0bff0a1b2e063 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8125/3ffea9dac003dde41d355f74c7c0bff0a1b2e063/smtplib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
17116,
12,
2890,
16,
28632,
273,
599,
16,
3320,
768,
273,
599,
4672,
3536,
26804,
326,
1459,
358,
326,
18102,
1438,
1368,
8098,
1965,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
787,
17116,
12,
2890,
16,
28632,
273,
599,
16,
3320,
768,
273,
599,
4672,
3536,
26804,
326,
1459,
358,
326,
18102,
1438,
1368,
8098,
1965,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100... |
if result == 1: | if result == gtk.RESPONSE_OK: | def run(self): self.dialog = self.get_widget("Property") result = self.dialog.run() if result == 1: self.save() self.dialog.destroy() return (self.save_name, self.save_value, self.recurse.get_active()) | 263c4c85734fd4a50a79829d6df315e613e326bf /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/263c4c85734fd4a50a79829d6df315e613e326bf/dialog.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
365,
18,
12730,
273,
365,
18,
588,
67,
6587,
2932,
1396,
7923,
563,
273,
365,
18,
12730,
18,
2681,
1435,
225,
309,
563,
422,
22718,
18,
14508,
67,
3141,
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,
1086,
12,
2890,
4672,
365,
18,
12730,
273,
365,
18,
588,
67,
6587,
2932,
1396,
7923,
563,
273,
365,
18,
12730,
18,
2681,
1435,
225,
309,
563,
422,
22718,
18,
14508,
67,
3141,
30,
365,
... |
split(vis=tms, outputvis=outms, datacolumn='data', width=chanbin, spw=chanselstr) | if datacolstr.lower() not in ['all', 'float_data', 'lag_data']: datacolstr = 'data' split(vis=tms, outputvis=outms, datacolumn=datacolstr, width=chanbin) | def time_then_chan_avg(inms, tbin, chanbin, outms="", zaptemp=True, zaporig=False, chanselstr=""): """ Bins time and frequency in 1.x passes. First inms is time averaged to in_timebin<tbin>.ms by split with timebin = tbin. Then in_timebin<tbin>.ms (much smaller than inms!) is channel averaged to outms by split with width = chanbin. outms: Name to use for the output MS. Defaults to inms - ".ms" + "_" + chanselstr + "_timebin" + tbin + "_width" + chanbin + ".ms". zaptemp: whether or not to delete the intermediate ms. zaporig: whether or not to delete the original ms. chanselstr: An spw:chan;step channel selection string corresponding to split's spw. Note that it is an error to select fewer than chanbin channels in any of the selected input spws. Defaulting to averaging all the channels would be reasonable in that case, but it would make it hard to detect more serious errors. Not that you should rely on casapy to detect your bad selection strings... """ casalog.origin('time_then_chan_avg') inms_root = inms.rpartition(".ms")[0] if not inms_root: inms_root = inms troot = inms_root + '_' + chanselstr + "_timebin" + tbin tms = troot + ".ms" # One annoying thing about having 2 passes of split is that the channel # selection string may need to be updated for the 2nd pass. timechansel = chanselstr cs_simplifications = [] funnyshapes = False try: # split currently can't do time averaging with differently shaped # output spws. Since this is time averaging followed by channel # averaging, simplify the chanselstr for time averaging, even though it # means averaging some data which will be rejected in the end. datacolstr = 'corrected' if (timechansel.find(':') > -1) and ((timechansel.find(',') > -1) or (timechansel.find(';') > -1)): funnyshapes = True chanpat = r':\d+(~\d+)?(;\d+)?' timechansel = re.sub(chanpat, '', timechansel) datacolstr = 'all' # writeDiffSpwShape() needs scratch columns. tb.open(inms) cns = tb.colnames() tb.close() if 'IMAGING_WEIGHT' not in cns: # So much for clearcal(vis=inms, spw=timechansel) # read-only input! ## print 'tbin =', tbin ## print 'tavspw =', timechansel ## print 'tavdc =', datacolstr ## print 'inms =', inms casalog.post("Time averaging to " + tms) split(vis=inms, outputvis=tms, timebin=tbin, spw=timechansel, datacolumn=datacolstr) ms.open(tms) nrows_aft_tavg = ms.nrow() ms.close() except Exception, e: casalog.post( | bcc7dfbcb0997ad01a952e0eb554a102e06407ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2098/bcc7dfbcb0997ad01a952e0eb554a102e06407ff/time_then_chan_avg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
813,
67,
15991,
67,
7472,
67,
14141,
12,
267,
959,
16,
268,
4757,
16,
3861,
4757,
16,
596,
959,
1546,
3113,
998,
1657,
30752,
33,
5510,
16,
11419,
4949,
33,
8381,
16,
462,
634,
292,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
813,
67,
15991,
67,
7472,
67,
14141,
12,
267,
959,
16,
268,
4757,
16,
3861,
4757,
16,
596,
959,
1546,
3113,
998,
1657,
30752,
33,
5510,
16,
11419,
4949,
33,
8381,
16,
462,
634,
292,
... |
u'[^\x09\x0A\x0D\u0020-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]', | u'[^\x09\x0A\x0D\u0020-\uD7FF\uE000-\uFFFD\U00010000-\U0010FFFF]', | def xhtmlify(html, encoding='UTF-8', self_closing_tags=SELF_CLOSING_TAGS, cdata_tags=CDATA_TAGS, structural_tags=STRUCTURAL_TAGS): """ Parses HTML and converts it to XHTML-style tags. Raises a ValidationError if the tags are badly nested or malformed. It is slightly stricter than normal HTML in some places and more lenient in others, but it generally tries to behave in a human-friendly way. It is intended to be idempotent, i.e. it should make no changes if fed its own output. It accepts XHTML-style self-closing tags. """ if not encoding: encoding = sniff_encoding(html) unicode_input = isinstance(html, unicode) if unicode_input: html = html.encode(encoding, 'strict') if not isinstance(html, str): raise TypeError("Expected string, got %s" % type(html)) html = html.decode(encoding, 'replace') # "in HTML, the Formfeed character (U+000C) is treated as white space" html = html.replace(u'\u000C', u' ') # Replace disallowed characters with U+FFFD (unicode replacement char) html = re.sub( # XML 1.0 section 2.2, "Char" production u'[^\x09\x0A\x0D\u0020-\uD7FF\uE000-\uFFFD\u10000-\u10FFFF]', u'\N{replacement character}', html) def ERROR(message, charpos=None): if charpos is None: charpos = pos line = html.count('\n', 0, charpos)+1 offset = charpos - html.rfind('\n', 0, charpos) raise ValidationError(message, charpos, line, offset, tags) for tag in cdata_tags: assert tag not in self_closing_tags assert 'div' not in structural_tags # can safely nest with <p>s assert 'span' not in structural_tags # ... but 'p' can be in structural_tags => disallow nested <p>s. tags = [] result = [] output = result.append lastpos = 0 tag_re = re.compile(TAG_RE, re.DOTALL | re.IGNORECASE) for tag_match in tag_re.finditer(html): pos = tag_match.start() prevtag = tags and tags[-1][0].lower() or None innards = tag_match.group(1) if innards is None: whole_tag = tag_match.group() if whole_tag.startswith('<!'): # CDATA, comment, or doctype-alike. Treat as text. if re.match(r'(?i)<!doctype[ \t\r\n]', whole_tag): output('<!DOCTYPE') lastpos += 9 continue assert whole_tag=='<' if prevtag in cdata_tags: continue # ignore until we have all the text else: ERROR('Unescaped "<" or unfinished tag') elif not innards: ERROR("Empty tag") text = html[lastpos:pos] if prevtag in cdata_tags: output(cdatafix(text)) else: output(ampfix(text)) m = re.compile(INNARDS_RE, re.DOTALL).match(innards) if prevtag in cdata_tags and (not m.group(3) or re.match(r'/(%s)' % NAME_RE, innards).group(1).lower()!=prevtag): # not the closing tag, output it as CDATA output('<![CDATA[%s]]>' % tag_match.group() .replace(']]>', ']]]]><![CDATA[>')) elif m.group(1): # opening tag endslash = m.group(2) m = re.match(NAME_RE, innards) TagName, attrs = m.group(), innards[m.end():] attrs = fix_attrs(attrs, ERROR=ERROR) tagname = TagName.lower() if prevtag in self_closing_tags: tags.pop() prevtag = tags and tags[-1][0].lower() or None # No tags other than <div> and <span> can self-nest (I think) # and we automatically close <p> tags before structural tags. if (tagname==prevtag and tagname not in ('div', 'span')) or ( prevtag=='p' and tagname in structural_tags): tags.pop() output('</%s>' % prevtag) #prevtag = tags and tags[-1][0].lower() or None # not needed if endslash: output('<%s%s>' % (tagname, attrs)) elif tagname in self_closing_tags: if attrs.rstrip()==attrs: attrs += ' ' output('<%s%s/>' % (tagname, attrs)) # preempt any closing tag tags.append((TagName, pos)) else: output('<%s%s>' % (tagname, attrs)) tags.append((TagName, pos)) elif m.group(3): # closing tag TagName = re.match(r'/(\w+)', innards).group(1) tagname = TagName.lower() if prevtag in self_closing_tags: # The tag has already been output in self-closed form. if prevtag==tagname: # explicit close # Minor hack: discard any whitespace we just output if result[-1].strip(): ERROR("Self-closing tag <%s/> is not empty" % tags[-1][0], tags[-1][1]) else: result.pop() else: tags.pop() prevtag = tags and tags[-1][0].lower() or None assert prevtag not in self_closing_tags # If we have found a mismatched close tag, we may insert # a close tag for the previous tag to fix it in some cases. # Specifically, closing a container can close an open child. if prevtag!=tagname and ( (prevtag=='p' and tagname in structural_tags) or (prevtag=='li' and tagname in ('ol', 'ul')) or (prevtag=='dd' and tagname=='dl') or (prevtag=='area' and tagname=='map') or (prevtag=='td' and tagname=='tr') or (prevtag=='th' and tagname=='tr') ): output('</%s>' % prevtag) tags.pop() prevtag = tags and tags[-1][0].lower() or None if prevtag==tagname: if tagname not in self_closing_tags: output(tag_match.group().lower()) tags.pop() else: ERROR("Unexpected closing tag </%s>" % TagName) elif m.group(4): # mismatch ERROR("Malformed tag") else: # We don't do any validation on pre-processing tags (<? ... >). output(ampfix(tag_match.group())) lastpos = tag_match.end() output(ampfix(html[lastpos:])) while tags: TagName, pos = tags.pop() tagname = TagName.lower() if tagname not in self_closing_tags: output('</%s>' % tagname) result = ''.join(result) if not unicode_input: # There's an argument that we should only ever deal in bytes, # but it's probably more helpful to say "unicode in => unicode out". result = result.encode(encoding) return result | 3a62d36c891d6d31f030c1b174efe9700515bec3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10679/3a62d36c891d6d31f030c1b174efe9700515bec3/xhtmlify.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
2620,
1164,
12,
2620,
16,
2688,
2218,
5159,
17,
28,
2187,
365,
67,
19506,
67,
4156,
33,
26280,
67,
22693,
23708,
67,
29915,
16,
20712,
67,
4156,
33,
18375,
67,
29915,
16,
1958,
37... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
619,
2620,
1164,
12,
2620,
16,
2688,
2218,
5159,
17,
28,
2187,
365,
67,
19506,
67,
4156,
33,
26280,
67,
22693,
23708,
67,
29915,
16,
20712,
67,
4156,
33,
18375,
67,
29915,
16,
1958,
37... |
done = thread.allocate_lock() done.acquire() | done = threading.Event() | def check_parallel_module_init(self): if imp.lock_held(): # This triggers on, e.g., from test import autotest. raise unittest.SkipTest("can't run when import lock is held") | eaa07a20a22a6abc0facbd9cc16ea70992847d98 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/eaa07a20a22a6abc0facbd9cc16ea70992847d98/test_threaded_import.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
67,
18054,
67,
2978,
67,
2738,
12,
2890,
4672,
309,
1646,
18,
739,
67,
76,
488,
13332,
468,
1220,
11752,
603,
16,
425,
18,
75,
12990,
628,
1842,
1930,
2059,
352,
395,
18,
1002,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
18054,
67,
2978,
67,
2738,
12,
2890,
4672,
309,
1646,
18,
739,
67,
76,
488,
13332,
468,
1220,
11752,
603,
16,
425,
18,
75,
12990,
628,
1842,
1930,
2059,
352,
395,
18,
1002,
... |
groupList.setValueFor('moderated_members', moderated_members) except: | groupList.manage_changeProperties(moderated_members=moderated_members) else: moderated_members = [self.getId()] | def add_groupWithNotification(self, group): """ Add a group to the user, and if available, send them a notification. """ import re acl_users = getattr(self, 'acl_users', None) site_root = self.site_root() | 961464063f59a05def2babfa5c15af3f39188251 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6270/961464063f59a05def2babfa5c15af3f39188251/CustomUser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
1655,
1190,
4386,
12,
2890,
16,
1041,
4672,
3536,
1436,
279,
1041,
358,
326,
729,
16,
471,
309,
2319,
16,
1366,
2182,
279,
3851,
18,
225,
3536,
1930,
283,
225,
7895,
67,
5577,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
1655,
1190,
4386,
12,
2890,
16,
1041,
4672,
3536,
1436,
279,
1041,
358,
326,
729,
16,
471,
309,
2319,
16,
1366,
2182,
279,
3851,
18,
225,
3536,
1930,
283,
225,
7895,
67,
5577,... |
msg += "<br><pre>%s</pre>" % wikiutil.escape(package.msg) else: msg = _('The file %s is not a MoinMoin package file.') % wikiutil.escape(target) | msg += " " + package.msg else: msg = _('The file %s is not a MoinMoin package file.') % target | def _do_install(pagename, request): _ = request.getText pagename, target, targetpath = _access_file(pagename, request) if not request.user.isSuperUser(): return _('You are not allowed to install files.') if not target: return package = packages.ZipPackage(request, targetpath) if package.isPackage(): if package.installPackage(): msg = _("Attachment '%(filename)s' installed.") % {'filename': wikiutil.escape(target)} else: msg = _("Installation of '%(filename)s' failed.") % {'filename': wikiutil.escape(target)} if package.msg: msg += "<br><pre>%s</pre>" % wikiutil.escape(package.msg) else: msg = _('The file %s is not a MoinMoin package file.') % wikiutil.escape(target) upload_form(pagename, request, msg=msg) | 4f71a45124d02748638e8d74d2c3674154ef49e4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/4f71a45124d02748638e8d74d2c3674154ef49e4/AttachFile.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
5425,
12,
9095,
1069,
16,
590,
4672,
389,
273,
590,
18,
588,
1528,
225,
4262,
1069,
16,
1018,
16,
1018,
803,
273,
389,
3860,
67,
768,
12,
9095,
1069,
16,
590,
13,
309,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2896,
67,
5425,
12,
9095,
1069,
16,
590,
4672,
389,
273,
590,
18,
588,
1528,
225,
4262,
1069,
16,
1018,
16,
1018,
803,
273,
389,
3860,
67,
768,
12,
9095,
1069,
16,
590,
13,
309,... |
outdir = job.runningJob['outputDirectory'] outdir = outdir[ : outdir.rfind('/') ] dashboardInfoFile = os.path.join(outdir, "DashboardInfo.xml" ) if os.path.exists(dashboardInfoFile): | dashboardInfo = DashboardInfo() jobdir = job.runningJob['outputDirectory'] jobdir = jobdir[ : jobdir.rfind('/') ] dashboardInfoFile = os.path.join(jobdir, "DashboardInfo.xml" ) if os.path.exists(dashboardInfoFile): | def publishSubmitToDashboard( self ): """ _publishSubmitToDashboard_ | 3593267e60c3b0c7f75211a792db60f99db6166d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8887/3593267e60c3b0c7f75211a792db60f99db6166d/BossLiteBulkInterface.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3808,
11620,
774,
14830,
12,
365,
262,
30,
3536,
389,
6543,
11620,
774,
14830,
67,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3808,
11620,
774,
14830,
12,
365,
262,
30,
3536,
389,
6543,
11620,
774,
14830,
67,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
return "The PermutationGroup of all legal moves of the Rubik's cube." | return "The PermutationGroup of all legal moves of the Rubik's cube." | def __repr__(self): | c4436c8abac791e198815503e74478ec5cbb6c54 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/c4436c8abac791e198815503e74478ec5cbb6c54/cubegroup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
12715,
972,
12,
2890,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
if current_person: | if current_person: | def add_data_entry(self, obj): from QuestionDialog import ErrorDialog # First, get the data: if "," in self.de_widgets["NPName"].get_text(): surname, firstname = self.de_widgets["NPName"].get_text().split(",", 1) else: surname, firstname = self.de_widgets["NPName"].get_text(), "" surname = surname.strip() firstname = firstname.strip() gender = self.de_widgets["NPGender"].get_active() if self._dirty: current_person = self._dirty_person else: current_person = self.get_active_object("Person") # Pre-check to make sure everything is ok: ------------------------------------------- if surname == "" and firstname == "": ErrorDialog(_("Please provide a name."), _("Can't add new person.")) return if self.de_widgets["NPRelation"].get_active() == self.NO_REL: # "No relation to active person" pass elif self.de_widgets["NPRelation"].get_active() == self.AS_PARENT: # "Add as a Parent" if current_person == None: ErrorDialog(_("Please set an active person."), _("Can't add new person as a parent.")) return elif gender == gen.lib.Person.UNKNOWN: # unknown ErrorDialog(_("Please set the new person's gender."), _("Can't add new person as a parent.")) return elif self.de_widgets["NPRelation"].get_active() == self.AS_SPOUSE: # "Add as a Spouse" if current_person == None: ErrorDialog(_("Please set an active person."), _("Can't add new person as a spouse.")) return elif (gender == gen.lib.Person.UNKNOWN and current_person.get_gender() == gen.lib.Person.UNKNOWN): # both genders unknown ErrorDialog(_("Please set the new person's gender."), _("Can't add new person as a spouse.")) return elif self.de_widgets["NPRelation"].get_active() == self.AS_SIBLING: # "Add as a Sibling" if current_person == None: ErrorDialog(_("Please set an active person."), _("Can't add new person as a sibling.")) return elif self.de_widgets["NPRelation"].get_active() == self.AS_CHILD: # "Add as a Child" if current_person == None: ErrorDialog(_("Please set an active person."), _("Can't add new person as a child.")) return # Start the transaction: ------------------------------------------------------------ self.trans = self.dbstate.db.transaction_begin() # New person -------------------------------------------------- # Add birth new_birth_date, new_birth_place = self.process_dateplace(self.de_widgets["NPBirth"].get_text().strip()) birth_event = self.make_event(gen.lib.EventType.BIRTH, new_birth_date, new_birth_place) if birth_event: # Only add if there is an event: source_text = self.de_widgets["NPBirthSource"].get_text().strip() if source_text: new, source = self.get_or_create_source(source_text) self.add_source(birth_event, source) self.dbstate.db.commit_event(birth_event, self.trans) # Add death new_death_date, new_death_place = self.process_dateplace(self.de_widgets["NPDeath"].get_text()) death_event = self.make_event(gen.lib.EventType.DEATH, new_death_date, new_death_place) if birth_event: # Only add if there is an event: source_text = self.de_widgets["NPDeathSource"].get_text().strip() if source_text: new, source = self.get_or_create_source(source_text) self.add_source(death_event, source) self.dbstate.db.commit_event(death_event, self.trans) # Now, create the person and events: person = self.make_person(firstname, surname, gender) # New birth for person: if birth_event: birth_ref = gen.lib.EventRef() birth_ref.set_reference_handle(birth_event.get_handle()) person.set_birth_ref(birth_ref) # New death for person: if death_event: death_ref = gen.lib.EventRef() death_ref.set_reference_handle(death_event.get_handle()) person.set_death_ref(death_ref) self.dbstate.db.add_person(person, self.trans) # All error checking done; just add relation: if self.de_widgets["NPRelation"].get_active() == self.NO_REL: # "No relation to active person" pass elif self.de_widgets["NPRelation"].get_active() == self.AS_PARENT: # "Add as a Parent" # Go through current_person parent families added = False for family_handle in current_person.get_parent_family_handle_list(): family = self.dbstate.db.get_family_from_handle(family_handle) if family: # find one that person would fit as a parent fam_husband_handle = family.get_father_handle() fam_wife_handle = family.get_mother_handle() # can we add person as wife? if fam_wife_handle == None and person.get_gender() == gen.lib.Person.FEMALE: # add the person family.set_mother_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.add_family_handle(family.get_handle()) added = True break elif fam_husband_handle == None and person.get_gender() == gen.lib.Person.MALE: # add the person family.set_father_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.add_family_handle(family.get_handle()) added = True break if added: self.dbstate.db.commit_family(family, self.trans) else: family = gen.lib.Family() self.dbstate.db.add_family(family, self.trans) if person.get_gender() == gen.lib.Person.MALE: family.set_father_handle(person.get_handle()) elif person.get_gender() == gen.lib.Person.FEMALE: family.set_mother_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) # add curent_person as child childref = gen.lib.ChildRef() childref.set_reference_handle(current_person.get_handle()) family.add_child_ref( childref) current_person.add_parent_family_handle(family.get_handle()) # finalize person.add_family_handle(family.get_handle()) self.dbstate.db.commit_family(family, self.trans) elif self.de_widgets["NPRelation"].get_active() == self.AS_SPOUSE: # "Add as a Spouse" added = False family = None for family_handle in current_person.get_family_handle_list(): family = self.dbstate.db.get_family_from_handle(family_handle) if family: fam_husband_handle = family.get_father_handle() fam_wife_handle = family.get_mother_handle() if current_person.get_handle() == fam_husband_handle: # can we add person as wife? if fam_wife_handle == None: if person.get_gender() == gen.lib.Person.FEMALE: # add the person family.set_mother_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.add_family_handle(family.get_handle()) added = True break elif person.get_gender() == gen.lib.Person.UNKNOWN: family.set_mother_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.set_gender(gen.lib.Person.FEMALE) self.de_widgets["NPGender"].set_active(gen.lib.Person.FEMALE) person.add_family_handle(family.get_handle()) added = True break elif current_person.get_handle() == fam_wife_handle: # can we add person as husband? if fam_husband_handle == None: if person.get_gender() == gen.lib.Person.MALE: # add the person family.set_father_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.add_family_handle(family.get_handle()) added = True break elif person.get_gender() == gen.lib.Person.UNKNOWN: family.set_father_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.add_family_handle(family.get_handle()) person.set_gender(gen.lib.Person.MALE) self.de_widgets["NPGender"].set_active(gen.lib.Person.MALE) added = True break if added: self.dbstate.db.commit_family(family, self.trans) else: if person.get_gender() == gen.lib.Person.UNKNOWN: if current_person.get_gender() == gen.lib.Person.UNKNOWN: ErrorDialog(_("Please set gender on Active or new person."), _("Can't add new person as a spouse.")) return elif current_person.get_gender() == gen.lib.Person.MALE: family = gen.lib.Family() self.dbstate.db.add_family(family, self.trans) family.set_father_handle(current_person.get_handle()) family.set_mother_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.set_gender(gen.lib.Person.FEMALE) self.de_widgets["NPGender"].set_active(gen.lib.Person.FEMALE) person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle()) self.dbstate.db.commit_family(family, self.trans) elif current_person.get_gender() == gen.lib.Person.FEMALE: family = gen.lib.Family() self.dbstate.db.add_family(family, self.trans) family.set_father_handle(person.get_handle()) family.set_mother_handle(current_person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.set_gender(gen.lib.Person.MALE) self.de_widgets["NPGender"].set_active(gen.lib.Person.MALE) person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle()) self.dbstate.db.commit_family(family, self.trans) elif person.get_gender() == gen.lib.Person.MALE: if current_person.get_gender() == gen.lib.Person.UNKNOWN: family = gen.lib.Family() self.dbstate.db.add_family(family, self.trans) family.set_father_handle(person.get_handle()) family.set_mother_handle(current_person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) current_person.set_gender(gen.lib.Person.FEMALE) person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle()) self.dbstate.db.commit_family(family, self.trans) elif current_person.get_gender() == gen.lib.Person.MALE: ErrorDialog(_("Same genders on Active and new person."), _("Can't add new person as a spouse.")) return elif current_person.get_gender() == gen.lib.Person.FEMALE: family = gen.lib.Family() self.dbstate.db.add_family(family, self.trans) family.set_father_handle(person.get_handle()) family.set_mother_handle(current_person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle()) self.dbstate.db.commit_family(family, self.trans) elif person.get_gender() == gen.lib.Person.FEMALE: if current_person.get_gender() == gen.lib.Person.UNKNOWN: family = gen.lib.Family() self.dbstate.db.add_family(family, self.trans) family.set_father_handle(current_person.get_handle()) family.set_mother_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) current_person.set_gender(gen.lib.Person.MALE) person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle()) self.dbstate.db.commit_family(family, self.trans) elif current_person.get_gender() == gen.lib.Person.MALE: family = gen.lib.Family() self.dbstate.db.add_family(family, self.trans) family.set_father_handle(current_person.get_handle()) family.set_mother_handle(person.get_handle()) family.set_relationship(gen.lib.FamilyRelType.MARRIED) person.add_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle()) self.dbstate.db.commit_family(family, self.trans) elif current_person.get_gender() == gen.lib.Person.FEMALE: ErrorDialog(_("Same genders on Active and new person."), _("Can't add new person as a spouse.")) return elif self.de_widgets["NPRelation"].get_active() == self.AS_SIBLING: # "Add as a Sibling" added = False for family_handle in current_person.get_parent_family_handle_list(): family = self.dbstate.db.get_family_from_handle(family_handle) if family: childref = gen.lib.ChildRef() childref.set_reference_handle(person.get_handle()) family.add_child_ref( childref) person.add_parent_family_handle(family.get_handle()) added = True break if added: self.dbstate.db.commit_family(family, self.trans) else: family = gen.lib.Family() self.dbstate.db.add_family(family, self.trans) childref = gen.lib.ChildRef() childref.set_reference_handle(person.get_handle()) family.add_child_ref( childref) childref = gen.lib.ChildRef() childref.set_reference_handle(current_person.get_handle()) family.add_child_ref( childref) person.add_parent_family_handle(family.get_handle()) current_person.add_parent_family_handle(family.get_handle()) self.dbstate.db.commit_family(family, self.trans) elif self.de_widgets["NPRelation"].get_active() == self.AS_CHILD: # "Add as a Child" added = False family = None for family_handle in current_person.get_family_handle_list(): family = self.dbstate.db.get_family_from_handle(family_handle) if family: childref = gen.lib.ChildRef() childref.set_reference_handle(person.get_handle()) family.add_child_ref( childref) person.add_parent_family_handle(family.get_handle()) added = True break if added: self.dbstate.db.commit_family(family, self.trans) else: if current_person.get_gender() == gen.lib.Person.UNKNOWN: ErrorDialog(_("Please set gender on Active person."), _("Can't add new person as a child.")) return else: family = gen.lib.Family() self.dbstate.db.add_family(family, self.trans) childref = gen.lib.ChildRef() childref.set_reference_handle(person.get_handle()) family.add_child_ref( childref) person.add_parent_family_handle(family.get_handle()) current_person.add_family_handle(family.get_handle()) if gen.lib.Person.FEMALE: family.set_mother_handle(current_person.get_handle()) else: family.set_father_handle(current_person.get_handle()) self.dbstate.db.commit_family(family, self.trans) # Commit changes ------------------------------------------------- if current_person: self.dbstate.db.commit_person(current_person, self.trans) if person: source_text = self.de_widgets["NPSource"].get_text().strip() if source_text: new, source = self.get_or_create_source(source_text) self.add_source(person, source) self.dbstate.db.commit_person(person, self.trans) self.dbstate.db.transaction_commit(self.trans, (_("Gramplet Data Entry: %s") % name_displayer.display(person))) | 861e586e662758397fc67efe6d3dd2d7c6559c1a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1491/861e586e662758397fc67efe6d3dd2d7c6559c1a/DataEntryGramplet.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
67,
892,
67,
4099,
12,
2890,
16,
1081,
4672,
628,
18267,
6353,
1930,
1068,
6353,
468,
5783,
16,
336,
326,
501,
30,
309,
5753,
316,
365,
18,
323,
67,
18148,
9614,
23430,
461,
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,
527,
67,
892,
67,
4099,
12,
2890,
16,
1081,
4672,
628,
18267,
6353,
1930,
1068,
6353,
468,
5783,
16,
336,
326,
501,
30,
309,
5753,
316,
365,
18,
323,
67,
18148,
9614,
23430,
461,
6,
... |
elif text.find(mediawiki_messages.get('whitelistedittitle', self.site())) != -1: | elif text.find(self.site().mediawiki_message('whitelistedittitle')) != -1: | def getEditPage(self, get_redirect=False, throttle = True, sysop = False, oldid = None, nofollow_redirects = False, change_edit_time = True): """ Get the contents of the Page via the edit page. Do not use this directly, use get() instead. | b0aabc06351064e8b26863db1c754a0ededcc537 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4404/b0aabc06351064e8b26863db1c754a0ededcc537/wikipedia.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21221,
1964,
12,
2890,
16,
336,
67,
7590,
33,
8381,
16,
18304,
273,
1053,
16,
2589,
556,
273,
1083,
16,
1592,
350,
273,
599,
16,
290,
792,
2392,
67,
22715,
273,
1083,
16,
2549,
67,
4... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
21221,
1964,
12,
2890,
16,
336,
67,
7590,
33,
8381,
16,
18304,
273,
1053,
16,
2589,
556,
273,
1083,
16,
1592,
350,
273,
599,
16,
290,
792,
2392,
67,
22715,
273,
1083,
16,
2549,
67,
4... |
child.stdin.close() | def emboss_translate(sequence, table=None, frame=None): """Call transeq, returns protein sequence as string.""" #TODO - Support transeq in Bio.Emboss.Applications? #(doesn't seem worthwhile as Biopython can do translations) if not sequence: raise ValueError(sequence) #Setup, cline = exes["transeq"] if len(sequence) < 100: filename = None cline += " -sequence asis:%s" % sequence else: #There are limits on command line string lengths... #use a temp file instead. filename = "Emboss/temp_transeq.txt" handle = open(filename,"w") SeqIO.write([SeqRecord(sequence, id="Test")], handle, "fasta") handle.flush() handle.close() cline += " -sequence %s" % filename cline += " -auto" #no prompting cline += " -filter" #use stdout if table is not None: cline += " -table %s" % str(table) if frame is not None: cline += " -frame %s" % str(frame) #Run the tool, child = subprocess.Popen(str(cline), stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=True, shell=(sys.platform!="win32")) child.stdin.close() out, err = child.communicate() #Check no error output: if err != "": raise ValueError(str(cline) + "\n" + err) #Check we could read it's output record = SeqIO.read(StringIO(out), "fasta") if 0 != child.wait(): raise ValueError(str(cline)) if filename: os.remove(filename) if not record.id.startswith("Test"): raise ValueError(str(cline)) else: if not record.id.startswith("asis"): raise ValueError(str(cline)) return str(record.seq) | 9e1fc0e6e8f02b87deff7627c532a625c6069dc4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7167/9e1fc0e6e8f02b87deff7627c532a625c6069dc4/test_Emboss.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31265,
8464,
67,
13929,
12,
6178,
16,
1014,
33,
7036,
16,
2623,
33,
7036,
4672,
3536,
1477,
13637,
5436,
16,
1135,
14314,
3102,
487,
533,
12123,
468,
6241,
300,
13619,
13637,
5436,
316,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31265,
8464,
67,
13929,
12,
6178,
16,
1014,
33,
7036,
16,
2623,
33,
7036,
4672,
3536,
1477,
13637,
5436,
16,
1135,
14314,
3102,
487,
533,
12123,
468,
6241,
300,
13619,
13637,
5436,
316,
... | |
(status, rusage) = pyrpm.runScript(script=swapon) | (status, rusage) = functions.runScript(script=swapon) | def swapon(device): swapon = "/sbin/swapon '%s'" % device print "Enable swap on '%s'" % device (status, rusage) = pyrpm.runScript(script=swapon) if status != 0: print "ERROR: swapon failed." return 1 return 0 | 4915e131711cebd9265ac7480e5c2fb141789685 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1143/4915e131711cebd9265ac7480e5c2fb141789685/disk.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7720,
265,
12,
5964,
4672,
7720,
265,
273,
2206,
87,
4757,
19,
22270,
265,
1995,
87,
4970,
738,
2346,
1172,
315,
8317,
7720,
603,
1995,
87,
4970,
738,
2346,
261,
2327,
16,
436,
9167,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7720,
265,
12,
5964,
4672,
7720,
265,
273,
2206,
87,
4757,
19,
22270,
265,
1995,
87,
4970,
738,
2346,
1172,
315,
8317,
7720,
603,
1995,
87,
4970,
738,
2346,
261,
2327,
16,
436,
9167,
1... |
patterns_path, warnfile) | patterns_path, warnfile)) | def main(): (options, args) = parser.parse_args() if len(args) != 2: parser.print_help() sys.exit(1) logfile = open(args[0], 'a', 0) warnfile = os.fdopen(int(args[1]), 'w', 0) # For now we aggregate all the alert_hooks. alert_hooks = [] for patterns_path in options.pattern_paths.split(','): alert_hooks.extend(monitors_util.build_alert_hooks_from_path( patterns_path, warnfile) monitors_util.process_input( sys.stdin, logfile, options.log_timestamp_format, alert_hooks) | f3d740bd30f31041cac768f7d9b3eec52a656647 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12268/f3d740bd30f31041cac768f7d9b3eec52a656647/console.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2774,
13332,
261,
2116,
16,
833,
13,
273,
2082,
18,
2670,
67,
1968,
1435,
309,
562,
12,
1968,
13,
480,
576,
30,
2082,
18,
1188,
67,
5201,
1435,
2589,
18,
8593,
12,
21,
13,
225,
15204... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
261,
2116,
16,
833,
13,
273,
2082,
18,
2670,
67,
1968,
1435,
309,
562,
12,
1968,
13,
480,
576,
30,
2082,
18,
1188,
67,
5201,
1435,
2589,
18,
8593,
12,
21,
13,
225,
15204... |
+ glob.glob(pjoin('..',dn+'-*',dn))\ + glob.glob(pjoin('..','..',dn+'-*',dn))\ | def _find_rl_ccode(dn='rl_accel',cn='_rl_accel.c'): '''locate where the accelerator code lives''' _ = [] for x in [ pjoin('src','rl_addons',dn), pjoin('rl_addons',dn), pjoin('..','rl_addons',dn), pjoin('..','..','rl_addons',dn), dn, pjoin('..',dn), pjoin('..','..',dn), ] \ + glob.glob(pjoin(dn+'-*',dn))\ + glob.glob(pjoin('..',dn+'-*',dn))\ + glob.glob(pjoin('..','..',dn+'-*',dn))\ : fn = pjoin(pkgDir,x,cn) if isfile(fn): _.append(x) if _: _ = filter(_rl_dir_info(cn),_) if len(_): _.sort(_cmp_rl_ccode_dirs) #return abspath(_[0]) return _[0] return None | a545547fd44e5beb024f728933ffaf18549bce47 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3878/a545547fd44e5beb024f728933ffaf18549bce47/setup_egg.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4720,
67,
1321,
67,
71,
710,
12,
5176,
2218,
1321,
67,
30737,
2187,
10305,
2218,
67,
1321,
67,
30737,
18,
71,
11,
4672,
9163,
25450,
1625,
326,
15153,
7385,
981,
328,
3606,
26418,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4720,
67,
1321,
67,
71,
710,
12,
5176,
2218,
1321,
67,
30737,
2187,
10305,
2218,
67,
1321,
67,
30737,
18,
71,
11,
4672,
9163,
25450,
1625,
326,
15153,
7385,
981,
328,
3606,
26418,
... | |
pass | if node.get('ids'): self.out += self.ids_to_labels(node) + ['\n'] | def depart_image(self, node): pass | fafce8a16ab34eb7a78359425703089e74d6bb63 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/1278/fafce8a16ab34eb7a78359425703089e74d6bb63/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
2730,
12,
2890,
16,
756,
4672,
1342,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
26000,
67,
2730,
12,
2890,
16,
756,
4672,
1342,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
item = gtk.MenuItem (_("Remove group %s")) % (self._group) | item = gtk.MenuItem (_("Remove group %s") % (self._group)) | def populate_grouping_menu (self, widget): groupitem = None | ae0422fb67c0ba5cdb8690be97ed0f91c6b61789 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6502/ae0422fb67c0ba5cdb8690be97ed0f91c6b61789/terminatorterm.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6490,
67,
25592,
67,
5414,
261,
2890,
16,
3604,
4672,
1041,
1726,
273,
599,
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,
6490,
67,
25592,
67,
5414,
261,
2890,
16,
3604,
4672,
1041,
1726,
273,
599,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
try: id, data = self.__cache_this_album(tracks) candidates[id] = data except TypeError: pass | candidate = self.__cache_this_album(tracks) if candidate != None: candidates[candidate.id] = candidate | def __lookup_by_album_name(self, album, tracks): candidates = {} self.mb.QueryWithArgs(MBQ_FindAlbumByName, [album]) | 608bf76589bbd778250b183d8a315759d22e7858 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4764/608bf76589bbd778250b183d8a315759d22e7858/brainz.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8664,
67,
1637,
67,
25090,
67,
529,
12,
2890,
16,
14844,
16,
13933,
4672,
7965,
273,
2618,
225,
365,
18,
1627,
18,
1138,
1190,
2615,
12,
7969,
53,
67,
3125,
30330,
5911,
16,
306,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
8664,
67,
1637,
67,
25090,
67,
529,
12,
2890,
16,
14844,
16,
13933,
4672,
7965,
273,
2618,
225,
365,
18,
1627,
18,
1138,
1190,
2615,
12,
7969,
53,
67,
3125,
30330,
5911,
16,
306,... |
m = r.search(s) if not m: | m = r.search(rest) found = False s = "" while m: found = True s += rest[:m.start()] + newval rest = rest[m.end():] m = r.search(rest) s += rest if not found: | def replace(fname, regex, newval, what): s = open(fname, "r").read() s_old = s r = re.compile(regex) m = r.search(s) if not m: print "%s: %s not found" % (fname, what) else: s = s[:m.start()] + newval + s[m.end():] if (s != s_old): open(fname, "w").write(s) print "%s: %s changed" % (fname, what) | 45ed65dfba57e799640cb447ab08cb8bd670e02b /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9898/45ed65dfba57e799640cb447ab08cb8bd670e02b/check-version.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1453,
12,
12749,
16,
3936,
16,
394,
1125,
16,
4121,
4672,
272,
273,
1696,
12,
12749,
16,
315,
86,
20387,
896,
1435,
272,
67,
1673,
273,
272,
436,
273,
283,
18,
11100,
12,
7584,
13,
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,
1453,
12,
12749,
16,
3936,
16,
394,
1125,
16,
4121,
4672,
272,
273,
1696,
12,
12749,
16,
315,
86,
20387,
896,
1435,
272,
67,
1673,
273,
272,
436,
273,
283,
18,
11100,
12,
7584,
13,
3... |
group_names = [] try: for rec in self.pool.get('res.users').read(cr, uid, group_users, ['name'], context=context): group_names.append(rec['name']) if len(group_names) >=5: group_names = group_names[:5] group_names += '...' except Exception: raise osv.except_osv(_('Warning !'), _('Make sure you have no users linked with the group(s)!')) | user_names = [user.name for user in self.pool.get('res.users').browse(cr, uid, group_users, context=context)] if len(user_names) >= 5: user_names = user_names[:5] user_names += '...' | def unlink(self, cr, uid, ids, context=None): group_users = [] for record in self.read(cr, uid, ids, ['users'], context=context): if record['users']: group_users.extend(record['users']) if group_users: group_names = [] try: for rec in self.pool.get('res.users').read(cr, uid, group_users, ['name'], context=context): group_names.append(rec['name']) if len(group_names) >=5: group_names = group_names[:5] group_names += '...' except Exception: raise osv.except_osv(_('Warning !'), _('Make sure you have no users linked with the group(s)!')) raise osv.except_osv(_('Warning !'), _('Group(s) cannot be deleted, because user(s) %s participate in them!') % \ ', '.join(group_names)) return super(groups2, self).unlink(cr, uid, ids, context=context) | c34d2ae6d4cdc3f4995751c5254257b7277940b5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7397/c34d2ae6d4cdc3f4995751c5254257b7277940b5/res_user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
1041,
67,
5577,
273,
5378,
364,
1409,
316,
365,
18,
896,
12,
3353,
16,
4555,
16,
3258,
16,
10228,
5577,
17337,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
8255,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
819,
33,
7036,
4672,
1041,
67,
5577,
273,
5378,
364,
1409,
316,
365,
18,
896,
12,
3353,
16,
4555,
16,
3258,
16,
10228,
5577,
17337,
... |
return re.sub(r"([+-]?[.0-9]+)[Ee]?([+-]?[0-9]+)", r"\1 \\times 10^{\2}", s) | m, e = floatpattern.match(s).groups() return r"%s \\times 10^{%d}" % (m, int(e)) | def latexnumber(s): """ Convert a string of the form "d.dddde-dd" to "d.dddd \times 10^{-dd}" """ return re.sub(r"([+-]?[.0-9]+)[Ee]?([+-]?[0-9]+)", r"\1 \\times 10^{\2}", s) | 93839b38b5d5fee5d9941f59939032deb6c48ec7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3592/93839b38b5d5fee5d9941f59939032deb6c48ec7/SnglBurstUtils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25079,
2696,
12,
87,
4672,
3536,
4037,
279,
533,
434,
326,
646,
315,
72,
18,
449,
72,
323,
17,
449,
6,
358,
315,
72,
18,
449,
449,
521,
8293,
1728,
66,
95,
17,
449,
1532,
3536,
312... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
25079,
2696,
12,
87,
4672,
3536,
4037,
279,
533,
434,
326,
646,
315,
72,
18,
449,
72,
323,
17,
449,
6,
358,
315,
72,
18,
449,
449,
521,
8293,
1728,
66,
95,
17,
449,
1532,
3536,
312... |
maxWidths[0] = maxWidths[0] - (bulletRight - style.firstLineIndent) | maxWidths[0] = maxWidths[0] - (bulletRight - indent) | def _handleBulletWidth(bulletText,style,maxWidths): '''work out bullet width and adjust maxWidths[0] if neccessary ''' if bulletText <> None: if type(bulletText) is StringType: bulletWidth = stringWidth( bulletText, style.bulletFontName, style.bulletFontSize) else: #it's a list of fragments bulletWidth = 0 for f in bulletText: bulletWidth = bulletWidth + stringWidth(f.text, f.fontName, f.fontSize) bulletRight = style.bulletIndent + bulletWidth if bulletRight > style.firstLineIndent: #..then it overruns, and we have less space available on line 1 maxWidths[0] = maxWidths[0] - (bulletRight - style.firstLineIndent) | 8f8ad2094f390b0f1bc05d368540a202a73fdeef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3878/8f8ad2094f390b0f1bc05d368540a202a73fdeef/paragraph.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
38,
19994,
2384,
12,
70,
19994,
1528,
16,
4060,
16,
1896,
22407,
4672,
9163,
1252,
596,
31650,
1835,
471,
5765,
17681,
87,
63,
20,
65,
309,
290,
557,
614,
814,
9163,
309,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
4110,
38,
19994,
2384,
12,
70,
19994,
1528,
16,
4060,
16,
1896,
22407,
4672,
9163,
1252,
596,
31650,
1835,
471,
5765,
17681,
87,
63,
20,
65,
309,
290,
557,
614,
814,
9163,
309,
31... |
"Compile a regular expression pattern, returning a RegexObject." | """compile(pattern[, flags]) -> RegexObject Compile a regular expression pattern into a regular expression object, which can be used for matching using its match() and search() methods. """ | def compile(pattern, flags=0): "Compile a regular expression pattern, returning a RegexObject." groupindex={} code=pcre_compile(pattern, flags, groupindex) return RegexObject(pattern, flags, code, groupindex) | 27efdb65ccdb88d4f7ed7c10c99789ee4bdeba48 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/27efdb65ccdb88d4f7ed7c10c99789ee4bdeba48/re.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
12,
4951,
16,
2943,
33,
20,
4672,
3536,
11100,
12,
4951,
63,
16,
2943,
5717,
317,
15078,
921,
225,
16143,
279,
6736,
2652,
1936,
1368,
279,
6736,
2652,
733,
16,
1492,
848,
506,
1... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
12,
4951,
16,
2943,
33,
20,
4672,
3536,
11100,
12,
4951,
63,
16,
2943,
5717,
317,
15078,
921,
225,
16143,
279,
6736,
2652,
1936,
1368,
279,
6736,
2652,
733,
16,
1492,
848,
506,
1... |
include_dirs=[mad_include_dir], library_dirs=[mad_lib_dir], libraries=mad_libs) | include_dirs=[data['mad_include_dir']], library_dirs=[data['mad_lib_dir']], libraries=string.split(data['mad_libs'])) | def get_setup(): data = {} r = re.compile(r'(\S+)\s*?=\s*?(.+)') if not os.path.isfile('Setup'): print "No 'Setup' file. Perhaps you need to run the configure script." sys.exit(1) f = open('Setup', 'r') for line in f.readlines(): m = r.search(line) if not m: print "Error in setup file:", line sys.exit(1) key = m.group(1) val = m.group(2) data[key] = val return data | 1b453684ed5a11afb0c79d964e294fe6fbec2da7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/9790/1b453684ed5a11afb0c79d964e294fe6fbec2da7/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
8401,
13332,
501,
273,
2618,
436,
273,
283,
18,
11100,
12,
86,
11,
4713,
55,
14456,
87,
14,
35,
18206,
87,
14,
35,
21133,
2506,
13,
225,
309,
486,
1140,
18,
803,
18,
291,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
8401,
13332,
501,
273,
2618,
436,
273,
283,
18,
11100,
12,
86,
11,
4713,
55,
14456,
87,
14,
35,
18206,
87,
14,
35,
21133,
2506,
13,
225,
309,
486,
1140,
18,
803,
18,
291,
... |
(filename, tempdir, p.stdout.read())) | (filename, tempdir, patch_output)) | def convert_line_endings(data): # Files without a trailing newline come out of Perforce (and possibly # other systems) with a trailing \r. Diff will see the \r and # add a "\ No newline at end of file" marker at the end of the file's # contents, which patch understands and will happily apply this to # a file with a trailing \r. # # The problem is that we normalize \r's to \n's, which breaks patch. # Our solution to this is to just remove that last \r and not turn # it into a \n. # # See http://code.google.com/p/reviewboard/issues/detail?id=386 # and http://reviews.review-board.org/r/286/ if data == "": return "" | 33f2590af5ac35008781f9cd0d6a9735b5adc0ff /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1600/33f2590af5ac35008781f9cd0d6a9735b5adc0ff/diffutils.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
1369,
67,
409,
899,
12,
892,
4672,
468,
6471,
2887,
279,
7341,
9472,
12404,
596,
434,
5722,
5734,
261,
464,
10016,
468,
1308,
14908,
13,
598,
279,
7341,
521,
86,
18,
13008,
9... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1765,
67,
1369,
67,
409,
899,
12,
892,
4672,
468,
6471,
2887,
279,
7341,
9472,
12404,
596,
434,
5722,
5734,
261,
464,
10016,
468,
1308,
14908,
13,
598,
279,
7341,
521,
86,
18,
13008,
9... |
using the given version or latest if None. | using the given version. | def get_intel_compiler_top(version=None, abi=None): """ Return the main path to the top-level dir of the Intel compiler, using the given version or latest if None. The compiler will be in <top>/bin/icl.exe (icc on linux), the include dir is <top>/include, etc. """ if is_win32: if not SCons.Util.can_read_reg: raise NoRegistryModuleError, "No Windows registry module was found" top = get_intel_registry_value('ProductDir', version, abi) if not os.path.exists(os.path.join(top, "Bin", "icl.exe")): raise MissingDirError, \ "Can't find Intel compiler in %s"%(top) elif is_linux: top = '/opt/intel_cc_%s'%version if not os.path.exists(os.path.join(top, "bin", "icc")): raise MissingDirError, \ "Can't find version %s Intel compiler in %s"%(version,top) return top | f0c6ae7e6988933ba1a2f5eb778be3af5b3bfe49 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/7126/f0c6ae7e6988933ba1a2f5eb778be3af5b3bfe49/intelc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
474,
292,
67,
9576,
67,
3669,
12,
1589,
33,
7036,
16,
24126,
33,
7036,
4672,
3536,
2000,
326,
2774,
589,
358,
326,
1760,
17,
2815,
1577,
434,
326,
3094,
292,
5274,
16,
1450,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
474,
292,
67,
9576,
67,
3669,
12,
1589,
33,
7036,
16,
24126,
33,
7036,
4672,
3536,
2000,
326,
2774,
589,
358,
326,
1760,
17,
2815,
1577,
434,
326,
3094,
292,
5274,
16,
1450,
... |
_regex = re.compile(r'^(.+):\s(.+)$') | def __init__(self, file): """ We only want to run subversion's info tool once so pull all the data here. """ | 1016153357d7997f7593047789d5ba8f39430343 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11102/1016153357d7997f7593047789d5ba8f39430343/symbolstore.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
585,
4672,
3536,
1660,
1338,
2545,
358,
1086,
720,
1589,
1807,
1123,
5226,
3647,
1427,
6892,
777,
326,
501,
2674,
18,
3536,
2,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
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,
585,
4672,
3536,
1660,
1338,
2545,
358,
1086,
720,
1589,
1807,
1123,
5226,
3647,
1427,
6892,
777,
326,
501,
2674,
18,
3536,
2,
-100,
-100,
-100,
-100,
-100... | |
if os.path.isfile(file): short_file = os.path.basename(file) output += "<a href=\"" + file_paths["public_html"] + "/images/" + set + "/" + short_file + "\" rel=\"lightbox[" + set + "]\">" if short_file == small: output += "<img src=\"" + file_paths["public_html"] + "/images/" + set + "/small/" + short_file + "\">" if files.__len__() > 1: output += '<div class="more">More images...</div>' output += "</a>\n"; | if os.path.isfile(file): short_file = os.path.basename(file) if file == 'captions': continue output += "<a href=\"" + file_paths["public_html"] + "/images/" + set + "/" + short_file + "\" rel=\"lightbox[" + set + "]\"" if short_file in caption: output += " title=\"" + caption[short_file] + "\"" output += ">" if short_file == small: output += "<img src=\"" + file_paths["public_html"] + "/images/" + set + "/small/" + short_file + "\">" if files.__len__() > 1: output += '<div class="more">More images...</div>' output += "</a>\n"; | def slideshow(set, small=None): """ Generate a slideshow of a set of images, randomly selecting one to show first, unless a file is specified. """ try: if small == None or small == "": # Randomly select a smaller image, set the width of the div to be # the width of image. small = random.choice(glob(file_paths["public_path"] + "/images/" + set + "/small/*")) else: small = file_paths["public_path"] + "/images/" + set + "/small/" + small output = "<div class=\"slideshow\" id=\"%s\" style=\"width: %dpx\">" % (set, int(Image.open(small).size[0])) small = os.path.basename(small) # Load up all the images in the set directory. files = glob(file_paths['public_path'] + "/images/" + set + '/*') for file in files: if os.path.isfile(file): short_file = os.path.basename(file) output += "<a href=\"" + file_paths["public_html"] + "/images/" + set + "/" + short_file + "\" rel=\"lightbox[" + set + "]\">" # If we're looking at the small one we've picked, display # it as well. if short_file == small: output += "<img src=\"" + file_paths["public_html"] + "/images/" + set + "/small/" + short_file + "\">" # If there are more than one image in the slideshow # then also display "more...". if files.__len__() > 1: output += '<div class="more">More images...</div>' output += "</a>\n"; output += "</div>\n" return output except IndexError: return "no images found" | 7448b40d1f189d7289154e53c34b09e4a17dd197 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12856/7448b40d1f189d7289154e53c34b09e4a17dd197/helpers.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
30119,
13606,
12,
542,
16,
5264,
33,
7036,
4672,
3536,
6654,
279,
30119,
13606,
434,
279,
444,
434,
4602,
16,
20153,
24674,
1245,
358,
2405,
1122,
16,
3308,
279,
585,
353,
1269,
18,
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,
30119,
13606,
12,
542,
16,
5264,
33,
7036,
4672,
3536,
6654,
279,
30119,
13606,
434,
279,
444,
434,
4602,
16,
20153,
24674,
1245,
358,
2405,
1122,
16,
3308,
279,
585,
353,
1269,
18,
3536... |
print """You will be prompted for the password for the user '%s' twice. Once to drop an existing database and then a second time for create the database """ % settings.DATABASE_USER | print("""You will be prompted for the password for the user '%s' twice. Once to drop the existing database and then a second time to create the database.""" % settings.DATABASE_USER) | def delete_db(settings): """Delete the old database.""" engine = settings.DATABASE_ENGINE if engine == 'sqlite3': try: os.unlink(settings.DATABASE_NAME) except OSError: pass elif engine == 'mysql': import _mysql s = _mysql.connect(host=settings.DATABASE_HOST, user=settings.DATABASE_USER, passwd=settings.DATABASE_PASSWORD) for cmd in ['drop database if exists %s', 'create database %s CHARACTER SET utf8 COLLATE utf8_general_ci']: s.query(cmd % settings.DATABASE_NAME) elif engine in ('postgresql', 'postgresql_psycopg2'): if settings.DATABASE_NAME == '': raise AssertionError, "You must specified a value for DATABASE_NAME in local_settings.py." if settings.DATABASE_USER == '': raise AssertionError, "You must specified a value for DATABASE_USER in local_settings.py." params=" --username=%s --password" % settings.DATABASE_USER if settings.DATABASE_HOST: params += " --host=%s" % settings.DATABASE_HOST if settings.DATABASE_PORT: params += " --port=%s" % settings.DATABASE_PORT params += " %s" % settings.DATABASE_NAME print """You will be prompted for the password for the user '%s' twice. Once to drop an existing database and then a second time for create the database """ % settings.DATABASE_USER for cmd in ['dropdb %s', 'createdb %s']: os.system(cmd % params) else: raise AssertionError, "Unknown database engine %s" % engine | 0b5b5bdddb5618fc3777a5e213b03abd527f7ab5 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13656/0b5b5bdddb5618fc3777a5e213b03abd527f7ab5/load_data.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1966,
12,
4272,
4672,
3536,
2613,
326,
1592,
2063,
12123,
4073,
273,
1947,
18,
22366,
67,
28980,
309,
4073,
422,
296,
19460,
23,
4278,
775,
30,
1140,
18,
318,
1232,
12,
4272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1430,
67,
1966,
12,
4272,
4672,
3536,
2613,
326,
1592,
2063,
12123,
4073,
273,
1947,
18,
22366,
67,
28980,
309,
4073,
422,
296,
19460,
23,
4278,
775,
30,
1140,
18,
318,
1232,
12,
4272,
... |
print mo, directory if not os.path.exists(directory): info('creating %s'%directory) os.makedirs(directory) | self.mkpath(directory) | def run(self): for po in glob.glob(os.path.join(PO_DIR,'*.po')): lang = os.path.basename(po[:-3]) mo = os.path.join('build', 'locale', lang, 'LC_MESSAGES', 'arandr.mo') | ed1abcbb4f6d4e8f2e2f342ee235bbff5ba057be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/4594/ed1abcbb4f6d4e8f2e2f342ee235bbff5ba057be/setup.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
364,
8275,
316,
4715,
18,
10581,
12,
538,
18,
803,
18,
5701,
12,
2419,
67,
4537,
11189,
11146,
1631,
26112,
30,
3303,
273,
1140,
18,
803,
18,
13909,
12,
1631,
105... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1086,
12,
2890,
4672,
364,
8275,
316,
4715,
18,
10581,
12,
538,
18,
803,
18,
5701,
12,
2419,
67,
4537,
11189,
11146,
1631,
26112,
30,
3303,
273,
1140,
18,
803,
18,
13909,
12,
1631,
105... |
if self.locationType = "3dloc": | if self.locationType == "3dloc": | def uploadSeishub(self): """ Upload xml file to seishub """ userid = "admin" passwd = "admin" | cdb296935764c4f637eb405e18bf7388bd815e22 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10470/cdb296935764c4f637eb405e18bf7388bd815e22/obspyck.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3617,
1761,
1468,
373,
12,
2890,
4672,
3536,
9414,
2025,
585,
358,
695,
1468,
373,
3536,
6709,
273,
315,
3666,
6,
19093,
273,
315,
3666,
6,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3617,
1761,
1468,
373,
12,
2890,
4672,
3536,
9414,
2025,
585,
358,
695,
1468,
373,
3536,
6709,
273,
315,
3666,
6,
19093,
273,
315,
3666,
6,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
raise ValueError("illegal MSRP relay address: %s" % description) | raise ValueError("illegal SIP proxy address: %s" % description) | def from_description(cls, description): if not description: return None match = cls._description_re.match(description) if match is None: raise ValueError("illegal MSRP relay address: %s" % description) return cls(**dict((k, v) for k, v in match.groupdict().iteritems() if v is not None)) | dda03f73b11f832e498df4cc0395efad6d9ab02b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5703/dda03f73b11f832e498df4cc0395efad6d9ab02b/datatypes.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
628,
67,
3384,
12,
6429,
16,
2477,
4672,
309,
486,
2477,
30,
327,
599,
845,
273,
2028,
6315,
3384,
67,
266,
18,
1916,
12,
3384,
13,
309,
845,
353,
599,
30,
1002,
2068,
2932,
31751,
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,
628,
67,
3384,
12,
6429,
16,
2477,
4672,
309,
486,
2477,
30,
327,
599,
845,
273,
2028,
6315,
3384,
67,
266,
18,
1916,
12,
3384,
13,
309,
845,
353,
599,
30,
1002,
2068,
2932,
31751,
3... |
print "PACKAGETYPE",attributes["packagetype"] | def buildPacketList(self, categorytag = None): if categorytag is not None: self.currList = "packages" self.currentSelectedTag = categorytag self.packetlist = [] for package in iSoftwareTools.packagesIndexlist[:]: prerequisites = package[0]["prerequisites"] if prerequisites.has_key("tag"): for foundtag in prerequisites["tag"]: if categorytag == foundtag: attributes = package[0]["attributes"] print "ATTRIBUTES",attributes if attributes.has_key("packagetype"): print "PACKAGETYPE",attributes["packagetype"] if attributes["packagetype"] == "internal": continue self.packetlist.append([attributes["name"], attributes["details"], attributes["shortdescription"], attributes["packagename"]]) else: self.packetlist.append([attributes["name"], attributes["details"], attributes["shortdescription"], attributes["packagename"]]) self.list = [] for x in self.packetlist: status = "" name = x[0].strip() details = x[1].strip() description = x[2].strip() packagename = x[3].strip() selectState = self.getSelectionState(details) if iSoftwareTools.installed_packetlist.has_key(packagename): if selectState == True: status = "remove" else: status = "installed" self.list.append(self.buildEntryComponent(name, details, description, packagename, status, selected = selectState)) else: if selectState == True: status = "install" else: status = "installable" self.list.append(self.buildEntryComponent(name, details, description, packagename, status, selected = selectState)) if len(self.list): self.list.sort(key=lambda x: x[0]) self["list"].style = "default" self['list'].setList(self.list) self["list"].updateList(self.list) self.selectionChanged() | aea461bb9dc35ab20a78bd141c785bcb5967e616 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6652/aea461bb9dc35ab20a78bd141c785bcb5967e616/plugin.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
6667,
682,
12,
2890,
16,
3150,
2692,
273,
599,
4672,
309,
3150,
2692,
353,
486,
599,
30,
365,
18,
17016,
682,
273,
315,
10308,
6,
365,
18,
2972,
7416,
1805,
273,
3150,
2692,
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,
1361,
6667,
682,
12,
2890,
16,
3150,
2692,
273,
599,
4672,
309,
3150,
2692,
353,
486,
599,
30,
365,
18,
17016,
682,
273,
315,
10308,
6,
365,
18,
2972,
7416,
1805,
273,
3150,
2692,
365,... | |
cursor_pos = len(self.editable_label.get_text()) | cursor_pos = len(self.editable_label.get_text())-1 | def evt_info_bar_left(self,event): cursor_pos=self.editable_label.get_cursor_position() if cursor_pos == -1: cursor_pos = len(self.editable_label.get_text()) cursor_res = cursor_pos - 1 self.editable_label.set_selection(cursor_res, cursor_res) | d7087e4dd016bdc1c2944bf4253b345d5143284e /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5280/d7087e4dd016bdc1c2944bf4253b345d5143284e/infobar.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6324,
67,
1376,
67,
3215,
67,
4482,
12,
2890,
16,
2575,
4672,
3347,
67,
917,
33,
2890,
18,
19653,
67,
1925,
18,
588,
67,
9216,
67,
3276,
1435,
309,
3347,
67,
917,
422,
300,
21,
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,
6324,
67,
1376,
67,
3215,
67,
4482,
12,
2890,
16,
2575,
4672,
3347,
67,
917,
33,
2890,
18,
19653,
67,
1925,
18,
588,
67,
9216,
67,
3276,
1435,
309,
3347,
67,
917,
422,
300,
21,
30,
... |
dialog = CreateFileChooser(_("Open Xbox Iso"), \ ("*.iso","*.ISO","*.gz","*.bz2","*.rar","*.000","*.001")) | patterns = [] for p in readers: patterns.extend( ["*"+i.lower() for i in p.patterns] ) patterns.extend( ["*"+i.upper() for i in p.patterns] ) print patterns dialog = CreateFileChooser(_("Open Xbox Iso"), patterns) | def on_button_xiso_browse_clicked(self, widget): dialog = CreateFileChooser(_("Open Xbox Iso"), \ ("*.iso","*.ISO","*.gz","*.bz2","*.rar","*.000","*.001")) dialog.show_all() result = dialog.run() dialog.hide_all() if result == gtk.RESPONSE_OK: self.iso_name = dialog.get_filename() self.ui_entry_xiso.set_text(self.iso_name) ###self.get_iso_infos(self.iso_name) if (self.xbe_name): pass #self.ui_entry_folder.set_text(os.path.join(os.getcwd(),self.xbe_name)) #self.ui_label_xbox_folder.set_markup("<small>%s</small>" % self.xbe_name) else: name = os.path.basename(self.iso_name) name, ext = os.path.splitext(name) #self.ui_label_xbox_folder.set_markup("<small>%s</small>" % name) | d86f2bb533a4557e131960eae5ef599347d8bf24 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2692/d86f2bb533a4557e131960eae5ef599347d8bf24/gxiso.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
603,
67,
5391,
67,
5674,
83,
67,
25731,
67,
7475,
329,
12,
2890,
16,
3604,
4672,
6884,
273,
5378,
364,
293,
316,
16527,
30,
6884,
18,
14313,
12,
8247,
7388,
15,
77,
18,
8167,
1435,
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,
5391,
67,
5674,
83,
67,
25731,
67,
7475,
329,
12,
2890,
16,
3604,
4672,
6884,
273,
5378,
364,
293,
316,
16527,
30,
6884,
18,
14313,
12,
8247,
7388,
15,
77,
18,
8167,
1435,
3... |
if ' ' in s: s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+') else: return quote(s, safe) | if ' ' in s: s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+') else: return quote(s, safe) | def quote_plus(s, safe = '/'): if ' ' in s: # replace ' ' with '+' s = string.join(string.split(s, ' '), '+') return quote(s, safe + '+') else: return quote(s, safe) | fcea3a44cb5bc4ca94c174353aba37f481e83a11 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/fcea3a44cb5bc4ca94c174353aba37f481e83a11/urllib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3862,
67,
10103,
12,
87,
16,
4183,
273,
2023,
4672,
309,
296,
296,
316,
272,
30,
468,
1453,
296,
296,
598,
10058,
272,
273,
533,
18,
5701,
12,
1080,
18,
4939,
12,
87,
16,
296,
296,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3862,
67,
10103,
12,
87,
16,
4183,
273,
2023,
4672,
309,
296,
296,
316,
272,
30,
468,
1453,
296,
296,
598,
10058,
272,
273,
533,
18,
5701,
12,
1080,
18,
4939,
12,
87,
16,
296,
296,
... |
this = apply(_quickfix.new_PaymentRef, args) | this = _quickfix.new_PaymentRef(*args) | def __init__(self, *args): this = apply(_quickfix.new_PaymentRef, args) try: self.this.append(this) except: self.this = this | 7e632099fd421880c8c65fb0cf610d338d115ee9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8819/7e632099fd421880c8c65fb0cf610d338d115ee9/quickfix.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
6032,
1957,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
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,
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,
380,
1968,
4672,
333,
273,
389,
19525,
904,
18,
2704,
67,
6032,
1957,
30857,
1968,
13,
775,
30,
365,
18,
2211,
18,
6923,
12,
2211,
13,
1335,
30,
365,
1... |
"""Fose on/off state button.""" def __init__(self): Link.__init__(self) self.gButton = None def SetState(self,state=None): """Sets state related info. If newState != none, sets to new state first. For convenience, returns state when done.""" if state == None: state = settings.get('bash.fose.on',False) elif state == -1: state = not settings.get('bash.fose.on',False) settings['bash.fose.on'] = state image = images[('checkbox.green.off','checkbox.green.on')[state]] tip = (_("FOSE Disabled"),_("FOSE Enabled"))[state] self.gButton.SetBitmapLabel(image.GetBitmap()) self.gButton.SetToolTip(tooltip(tip)) tipAttr = ('tip','foseTip')[state] for button in App_Button.foseButtons: button.gButton.SetToolTip(tooltip(getattr(button,tipAttr,''))) def GetBitmapButton(self,window,style=0): exeFose = bosh.dirs['app'].join('fose_loader.exe') if exeFose.exists(): bitmap = images['checkbox.green.off'].GetBitmap() self.gButton = bitmapButton(window,bitmap,style=style,onClick=self.Execute) self.gButton.SetSize((16,16)) self.SetState() return self.gButton else: return None def Execute(self,event): """Invert state.""" self.SetState(-1) | """Fose on/off state button.""" def __init__(self): Link.__init__(self) self.gButton = None def SetState(self,state=None): """Sets state related info. If newState != none, sets to new state first. For convenience, returns state when done.""" if state == None: state = settings.get('bash.fose.on',False) elif state == -1: state = not settings.get('bash.fose.on',False) settings['bash.fose.on'] = state image = images[('checkbox.green.off','checkbox.green.on')[state]] tip = (_("FOSE Disabled"),_("FOSE Enabled"))[state] self.gButton.SetBitmapLabel(image.GetBitmap()) self.gButton.SetToolTip(tooltip(tip)) tipAttr = ('tip','foseTip')[state] for button in App_Button.foseButtons: button.gButton.SetToolTip(tooltip(getattr(button,tipAttr,''))) def GetBitmapButton(self,window,style=0): exeFose = bosh.dirs['app'].join('fose_loader.exe') if exeFose.exists(): bitmap = images['checkbox.green.off'].GetBitmap() self.gButton = bitmapButton(window,bitmap,style=style,onClick=self.Execute) self.gButton.SetSize((16,16)) self.SetState() return self.gButton else: return None def Execute(self,event): """Invert state.""" self.SetState(-1) | def Execute(self,event): App_Button.Execute(self,event) if settings.get('bash.autoQuit.on',False): bashFrame.Close() | 3ac43907fa076fea1e8d682219e2b28fc7419f7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/3ac43907fa076fea1e8d682219e2b28fc7419f7b/basher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
12,
2890,
16,
2575,
4672,
4677,
67,
3616,
18,
5289,
12,
2890,
16,
2575,
13,
309,
1947,
18,
588,
2668,
28734,
18,
6079,
25365,
18,
265,
2187,
8381,
4672,
24817,
3219,
18,
4605,
14... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
7903,
12,
2890,
16,
2575,
4672,
4677,
67,
3616,
18,
5289,
12,
2890,
16,
2575,
13,
309,
1947,
18,
588,
2668,
28734,
18,
6079,
25365,
18,
265,
2187,
8381,
4672,
24817,
3219,
18,
4605,
14... |
if reply.header.cmdrName == self.connection.cmdr: | if reply.header.cmdrName.endswith(self.connection.cmdr) \ and reply.header.cmdrName[-len(self.connection.cmdr) - 1: -len(self.connection.cmdr)] in ("", "."): | def dispatchReply(self, reply): """Set KeyVars based on the supplied Reply reply is a parsed Reply object (opscore.protocols.messages.Reply) whose fields include: - header.program: name of the program that triggered the message (string) - header.commandId: command ID that triggered the message (int) - header.actor: the actor that generated the message (string) - header.code: the message type code (opscore.protocols.types.Enum) - string: the original unparsed message (string) - keywords: an ordered dictionary of message keywords (opscore.protocols.messages.Keywords) Refer to https://trac.sdss3.org/wiki/Ops/Protocols for details. """ # handle KeyVars keydispatcher.KeyVarDispatcher.dispatchReply(self, reply, doCallbacks=self._enableCallbacks) | 0d840fab8b9befe94152ff07d3b0cb5679f5b6ae /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/425/0d840fab8b9befe94152ff07d3b0cb5679f5b6ae/cmdkeydispatcher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
7817,
12,
2890,
16,
4332,
4672,
3536,
694,
1929,
5555,
2511,
603,
326,
4580,
16202,
225,
4332,
353,
279,
2707,
16202,
733,
261,
556,
6355,
18,
31018,
18,
6833,
18,
7817,
13,
8272,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3435,
7817,
12,
2890,
16,
4332,
4672,
3536,
694,
1929,
5555,
2511,
603,
326,
4580,
16202,
225,
4332,
353,
279,
2707,
16202,
733,
261,
556,
6355,
18,
31018,
18,
6833,
18,
7817,
13,
8272,
... |
bytes_recv += len(chunk) | if not rein_sent: rein_sent = 1 self.client.sendcmd('rein') self.assertRaises(ftplib.error_perm, self.client.dir) | def test_rein_during_transfer(self): self.client.login(user=USER, passwd=PASSWD) data = 'abcde12345' * 100000 self.f1.write(data) self.f1.close() | 08be9d0ff55d04c1e20c062b48af2c54c427a77d /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7236/08be9d0ff55d04c1e20c062b48af2c54c427a77d/test_ftpd.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
266,
267,
67,
72,
4017,
67,
13866,
12,
2890,
4672,
365,
18,
2625,
18,
5819,
12,
1355,
33,
4714,
16,
19093,
33,
10884,
16006,
13,
501,
273,
296,
18947,
323,
2138,
25574,
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
266,
267,
67,
72,
4017,
67,
13866,
12,
2890,
4672,
365,
18,
2625,
18,
5819,
12,
1355,
33,
4714,
16,
19093,
33,
10884,
16006,
13,
501,
273,
296,
18947,
323,
2138,
25574,
11,
... |
def uname(): PROCESSOR_ARCHITECTURE = getenv("PROCESSOR_ARCHITECTURE") return (env_OS, "", PROCESSOR_ARCHITECTURE, "", PROCESSOR_ARCHITECTURE) | if IsInterix(): from os import uname else: def uname(): PROCESSOR_ARCHITECTURE = getenv("PROCESSOR_ARCHITECTURE") return (env_OS, "", PROCESSOR_ARCHITECTURE, "", PROCESSOR_ARCHITECTURE) | def uname(): PROCESSOR_ARCHITECTURE = getenv("PROCESSOR_ARCHITECTURE") return (env_OS, "", PROCESSOR_ARCHITECTURE, "", PROCESSOR_ARCHITECTURE) | 5b495f53319b3de03f1cf36ff92a9e414b0d05fd /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9328/5b495f53319b3de03f1cf36ff92a9e414b0d05fd/pylib.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
31444,
13332,
20647,
916,
67,
10586,
1285,
4239,
4830,
273,
11740,
2932,
16560,
916,
67,
10586,
1285,
4239,
4830,
7923,
327,
261,
3074,
67,
4618,
16,
23453,
20647,
916,
67,
10586,
1285,
42... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
31444,
13332,
20647,
916,
67,
10586,
1285,
4239,
4830,
273,
11740,
2932,
16560,
916,
67,
10586,
1285,
4239,
4830,
7923,
327,
261,
3074,
67,
4618,
16,
23453,
20647,
916,
67,
10586,
1285,
42... |
return None | raise errors.BlockDeviceError("Can't find a free MD minor") | def _FindUnusedMinor(): """Compute an unused MD minor. | 0caf64850b93a82f06124a9af90a8afd83932262 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7542/0caf64850b93a82f06124a9af90a8afd83932262/bdev.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
3125,
21106,
19549,
13332,
3536,
7018,
392,
10197,
10852,
8439,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3125,
21106,
19549,
13332,
3536,
7018,
392,
10197,
10852,
8439,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
Column('name', Integer, ), | Column('name', Text, ), | def make_tables( me): t1 = Table('table1', me.meta, Column('name', Integer, ), Column('id', Integer, primary_key=True), Column('t2_id', Integer, ForeignKey('table2.id',) ) ) | 0f83da09f61ddca2ef8ebb0e70a73f03c5bed818 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/10808/0f83da09f61ddca2ef8ebb0e70a73f03c5bed818/ref_AxA.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
9373,
12,
1791,
4672,
268,
21,
273,
3555,
2668,
2121,
21,
2187,
1791,
18,
3901,
16,
4753,
2668,
529,
2187,
3867,
16,
262,
16,
4753,
2668,
350,
2187,
2144,
16,
3354,
67,
856,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
67,
9373,
12,
1791,
4672,
268,
21,
273,
3555,
2668,
2121,
21,
2187,
1791,
18,
3901,
16,
4753,
2668,
529,
2187,
3867,
16,
262,
16,
4753,
2668,
350,
2187,
2144,
16,
3354,
67,
856,
... |
sage.structure.parent_gens.ParentWithGens.__init__(self, self, (names,), normalize=False) | sage.structure.parent_gens.ParentWithGens.__init__(self, base, (names,), normalize=False) | def __init__(self, prec, names): self._prec = prec sage.structure.parent_gens.ParentWithGens.__init__(self, self, (names,), normalize=False) | aec22413fb2f6b6c3d7098886b28d2b60e10e0de /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/aec22413fb2f6b6c3d7098886b28d2b60e10e0de/local_generic.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
13382,
16,
1257,
4672,
365,
6315,
4036,
273,
13382,
272,
410,
18,
7627,
18,
2938,
67,
23730,
18,
3054,
1190,
43,
773,
16186,
2738,
972,
12,
2890,
16,
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,
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,
13382,
16,
1257,
4672,
365,
6315,
4036,
273,
13382,
272,
410,
18,
7627,
18,
2938,
67,
23730,
18,
3054,
1190,
43,
773,
16186,
2738,
972,
12,
2890,
16,
365... |
linecache.getline(filename, lineno)), end=' ') | linecache.getline(filename, lineno)), end='') | def localtrace_trace_and_count(self, frame, why, arg): if why == "line": # record the file name and line number of every trace filename = frame.f_code.co_filename lineno = frame.f_lineno key = filename, lineno self.counts[key] = self.counts.get(key, 0) + 1 | d05531479e33b733ad9dc7fbe1243f0a06a7ab88 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3187/d05531479e33b733ad9dc7fbe1243f0a06a7ab88/trace.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
5129,
67,
5129,
67,
464,
67,
1883,
12,
2890,
16,
2623,
16,
11598,
16,
1501,
4672,
309,
11598,
422,
315,
1369,
6877,
468,
1409,
326,
585,
508,
471,
980,
1300,
434,
3614,
2606,
154... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1191,
5129,
67,
5129,
67,
464,
67,
1883,
12,
2890,
16,
2623,
16,
11598,
16,
1501,
4672,
309,
11598,
422,
315,
1369,
6877,
468,
1409,
326,
585,
508,
471,
980,
1300,
434,
3614,
2606,
154... |
self.edition.set_physical_dimensions(edition_data.pop('physical_dimensions')) self.edition.set_weight(edition_data.pop('weight')) | self.edition.set_physical_dimensions(edition_data.pop('physical_dimensions', None)) self.edition.set_weight(edition_data.pop('weight', None)) | def save(self, formdata): """Update work and edition documents according to the specified formdata.""" work_data, edition_data = self.process_input(formdata) if work_data: self.work.update(work_data) self.work._save() if self.edition and edition_data: identifiers = edition_data.pop('identifiers', []) self.edition.set_identifiers(identifiers) self.edition.set_physical_dimensions(edition_data.pop('physical_dimensions')) self.edition.set_weight(edition_data.pop('weight')) self.edition.update(edition_data) self.edition._save() | 5e199e9717ff6f4b49ebad6a6416d06b88e01951 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3913/5e199e9717ff6f4b49ebad6a6416d06b88e01951/addbook.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
30642,
4672,
3536,
1891,
1440,
471,
28432,
7429,
4888,
358,
326,
1269,
30642,
12123,
1440,
67,
892,
16,
28432,
67,
892,
273,
365,
18,
2567,
67,
2630,
12,
687,
892,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1923,
12,
2890,
16,
30642,
4672,
3536,
1891,
1440,
471,
28432,
7429,
4888,
358,
326,
1269,
30642,
12123,
1440,
67,
892,
16,
28432,
67,
892,
273,
365,
18,
2567,
67,
2630,
12,
687,
892,
... |
f = OsFileWrapper.create_wrapper(p, os.O_RDONLY) | f = create_wrapper(p, os.O_RDONLY) | def test_reads(): p = str(udir.join('test.dat')) # As we are testing file writes, only using udir to create a path buf = "1234567890" f = open(p, "w") f.write(buf) f.close() for ii in range(10): f = OsFileWrapper.create_wrapper(p, os.O_RDONLY) assert f.read(ii) == buf[:ii] | e2bf57f9afd0dab2a436e4e5324d1ce6fffa4d29 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/e2bf57f9afd0dab2a436e4e5324d1ce6fffa4d29/test_osfilewrapper.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
11904,
13332,
225,
293,
273,
609,
12,
1100,
481,
18,
5701,
2668,
3813,
18,
3404,
26112,
225,
468,
2970,
732,
854,
7769,
585,
7262,
16,
1338,
1450,
582,
1214,
358,
752,
279,
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,
1842,
67,
11904,
13332,
225,
293,
273,
609,
12,
1100,
481,
18,
5701,
2668,
3813,
18,
3404,
26112,
225,
468,
2970,
732,
854,
7769,
585,
7262,
16,
1338,
1450,
582,
1214,
358,
752,
279,
5... |
[('product_id', '=', prod_id)] + where) | [('product_id', '=', tmpl_id)] + where) | def price_get(self, cr, uid, ids, prod_id, qty, partner=None, context=None): ''' context = { 'uom': Unit of Measure (int), 'partner': Partner ID (int), 'date': Date of the pricelist (%Y-%m-%d), } ''' currency_obj = self.pool.get('res.currency') product_obj = self.pool.get('product.product') supplierinfo_obj = self.pool.get('product.supplierinfo') price_type_obj = self.pool.get('product.price.type') | d2d7567352c2e65b5a5c915f7492ef19193f786d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/d2d7567352c2e65b5a5c915f7492ef19193f786d/pricelist.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6205,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
10791,
67,
350,
16,
26667,
16,
19170,
33,
7036,
16,
819,
33,
7036,
4672,
9163,
819,
273,
288,
296,
89,
362,
4278,
8380,
434... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
6205,
67,
588,
12,
2890,
16,
4422,
16,
4555,
16,
3258,
16,
10791,
67,
350,
16,
26667,
16,
19170,
33,
7036,
16,
819,
33,
7036,
4672,
9163,
819,
273,
288,
296,
89,
362,
4278,
8380,
434... |
tmpf.write(result_format % (val, res, tbox, i, date, browser_config['branch'], browser_config['buildid'], "discrete", page)) | tmpf.write(result_format % (val, res + '_loadtime', tbox, i, date, browser_config['branch'], browser_config['buildid'], "discrete", page)) | def send_to_graph(title, date, browser_config, results): tbox = title url_format = "http://%s/%s" link_format= "<a href = \"%s\">%s</a>" #value, testname, tbox, timeval, date, branch, buildid, type, data result_format = "%.2f,%s,%s,%d,%d,%s,%s,%s,%s,\n" result_format2 = "%.2f,%s,%s,%d,%d,%s,%s,%s,\n" links = '' for res in results: filename = tempfile.mktemp() tmpf = open(filename, "w") browser_dump, counter_dump = results[res] filename = tempfile.mktemp() tmpf = open(filename, "w") if res == 'ts': i = 0 for val in browser_dump: tmpf.write(result_format % (float(val), res, tbox, i, date, browser_config['branch'], browser_config['buildid'], "discrete", "ms")) i += 1 if (res.find('tp') > -1) or (res == 'tdhtml'): # each line of the string is of the format i;page_name;median;mean;min;max;time vals\n for bd in browser_dump: bd.rstrip('\n') page_results = bd.splitlines() i = 0 for mypage in page_results[2:]: r = mypage.split(';') if r[1].find('/') > -1 : page = r[1].split('/')[1] else: page = r[1] try: val = float(r[2]) except ValueError: print 'WARNING: value error for median in tp' val = 0 tmpf.write(result_format % (val, res, tbox, i, date, browser_config['branch'], browser_config['buildid'], "discrete", page)) i += 1 tmpf.flush() tmpf.close() links += post_chunk(res, filename) os.remove(filename) for cd in counter_dump: for count_type in cd: val_list = cd[count_type] chunks = chunk_list(val_list) chunk_link = '' for chunk in chunks: filename = tempfile.mktemp() tmpf = open(filename, "w") i = 0 for val in chunk: tmpf.write(result_format2 % (float(val), res + "_" + count_type.replace("%", "Percent"), tbox, i, date, browser_config['branch'], browser_config['buildid'], "discrete")) i += 1 tmpf.flush() tmpf.close() chunk_link = post_chunk('%s_%s (%d values)' % (res, count_type, len(chunk)), filename) os.remove(filename) links += chunk_link lines = links.split('\n') for line in lines: if line == "": continue values = line.split(":") linkName = values[1] if float(values[2]) > 0: linkName += "_T: " + values[2] else: linkName += "_1" url = url_format % (config.RESULTS_SERVER, values[0],) link = link_format % (url, linkName,) print "RETURN: " + link | b9563fd4ae26ddcb7161926b3367953435bce00c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/13067/b9563fd4ae26ddcb7161926b3367953435bce00c/run_tests.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
869,
67,
4660,
12,
2649,
16,
1509,
16,
4748,
67,
1425,
16,
1686,
4672,
268,
2147,
273,
2077,
880,
67,
2139,
273,
315,
2505,
23155,
87,
5258,
87,
6,
1692,
67,
2139,
33,
3532... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1366,
67,
869,
67,
4660,
12,
2649,
16,
1509,
16,
4748,
67,
1425,
16,
1686,
4672,
268,
2147,
273,
2077,
880,
67,
2139,
273,
315,
2505,
23155,
87,
5258,
87,
6,
1692,
67,
2139,
33,
3532... |
for (token, value) in PythonLexer().get_tokens(source): | for (token, value) in all_tokens: | def reprint_line(lineno, s, to_replace=[]): if lineno < 0: return t = list(PythonLexer().get_tokens(s)) for (i, token) in to_replace: t[i] = token o = format(t, BPythonFormatter(OPTS.color_scheme)) self.scr.move(lineno, 4) map(self.echo, o.split('\x04')) | 34e57a080a61ccd061624a88f03dc3241a83c8ac /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6932/34e57a080a61ccd061624a88f03dc3241a83c8ac/cli.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1188,
67,
1369,
12,
17782,
16,
272,
16,
358,
67,
2079,
33,
8526,
4672,
309,
7586,
411,
374,
30,
327,
268,
273,
666,
12,
15774,
13356,
7675,
588,
67,
7860,
12,
87,
3719,
364,
261... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
283,
1188,
67,
1369,
12,
17782,
16,
272,
16,
358,
67,
2079,
33,
8526,
4672,
309,
7586,
411,
374,
30,
327,
268,
273,
666,
12,
15774,
13356,
7675,
588,
67,
7860,
12,
87,
3719,
364,
261... |
base_typedef = TypeDef( | W_BaseConnection.typedef = TypeDef( | def recv(self, space): self._check_readable(space) | c8a395526acc384b8abc9423dba4c5bcf6d8e363 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/c8a395526acc384b8abc9423dba4c5bcf6d8e363/interp_connection.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
10665,
12,
2890,
16,
3476,
4672,
365,
6315,
1893,
67,
11018,
12,
2981,
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,
... | [
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,
10665,
12,
2890,
16,
3476,
4672,
365,
6315,
1893,
67,
11018,
12,
2981,
13,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
"CVSRevision":"$Revision: 1.108 $", | "CVSRevision":"$Revision: 1.109 $", | def callingparams(self): """Returns list of parameters to save with results.""" #Test whether k has been set try: self.k except (NameError, AttributeError): self.k=None try: self.mass except (NameError, AttributeError): self.mass=None #Form dictionary of inputs params = {"ystart":self.ystart, "tstart":self.tstart, "tend":self.tend, "tstep_wanted":self.tstep_wanted, "tstep_min":self.tstep_min, "k":self.k, #model dependent params "mass":self.mass, "eps":self.eps, "dxsav":self.dxsav, "solver":self.solver, "classname":self.__class__.__name__, "CVSRevision":"$Revision: 1.108 $", "datetime":datetime.datetime.now() } return params | 232b5bb3eda4635022609feb8585ae3bd893da90 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7283/232b5bb3eda4635022609feb8585ae3bd893da90/cosmomodels.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4440,
2010,
12,
2890,
4672,
3536,
1356,
666,
434,
1472,
358,
1923,
598,
1686,
12123,
468,
4709,
2856,
417,
711,
2118,
444,
775,
30,
365,
18,
79,
1335,
261,
461,
668,
16,
6394,
4672,
36... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4440,
2010,
12,
2890,
4672,
3536,
1356,
666,
434,
1472,
358,
1923,
598,
1686,
12123,
468,
4709,
2856,
417,
711,
2118,
444,
775,
30,
365,
18,
79,
1335,
261,
461,
668,
16,
6394,
4672,
36... |
number_str = "%s%d." % (prefix, cur_index) | numbers = prefix + (str(sectnum),) | def update_section_numbers(self, node, prefix, depth): cur_index = 1 for child in node: if isinstance(child, nodes.section): number_str = "%s%d." % (prefix, cur_index) title = child[0] child['autonum_origtitle'] = copy_and_filter(self.document, title) child['autonum_prefix'] = prefix if isinstance(title[0], nodes.Text): title[0].data = number_str + " " + title[0].data else: title.insert(0, nodes.Text(number_str + " ")) if depth < self.maxdepth: self.update_section_numbers(child, number_str, depth+1) cur_index += 1 | e3f923e077187dea1181d53a0ed028dac271f831 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1278/e3f923e077187dea1181d53a0ed028dac271f831/parts.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1089,
67,
3464,
67,
13851,
12,
2890,
16,
756,
16,
1633,
16,
3598,
4672,
662,
67,
1615,
273,
404,
364,
1151,
316,
756,
30,
309,
1549,
12,
3624,
16,
2199,
18,
3464,
4672,
5600,
273,
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,
1089,
67,
3464,
67,
13851,
12,
2890,
16,
756,
16,
1633,
16,
3598,
4672,
662,
67,
1615,
273,
404,
364,
1151,
316,
756,
30,
309,
1549,
12,
3624,
16,
2199,
18,
3464,
4672,
5600,
273,
16... |
An RealNumber or ComplexNumber approximation of self with prec bits of precision. EXAMPLES: sage: cos(3).numerical_approximation() | A RealNumber or ComplexNumber approximation of self with prec bits of precision. EXAMPLES: sage: cos(3).numerical_approx() | def numerical_approximation(self, prec=53): """ Get a numerical approximation of self as either a real or complex number. | 620e070c69b2ba56d65f620b55649fc43ff77bab /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/620e070c69b2ba56d65f620b55649fc43ff77bab/calculus.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17409,
67,
26742,
5115,
12,
2890,
16,
13382,
33,
8643,
4672,
3536,
968,
279,
17409,
24769,
434,
365,
487,
3344,
279,
2863,
578,
7233,
1300,
18,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
17409,
67,
26742,
5115,
12,
2890,
16,
13382,
33,
8643,
4672,
3536,
968,
279,
17409,
24769,
434,
365,
487,
3344,
279,
2863,
578,
7233,
1300,
18,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print "Cache hit",path | def get_background_items_full(self, provider, window, item): """ Menu activated on entering a directory. Builds context menu for File menu and for window background. | becd0ba6a920de5bf02e8cdb9b2b5492e1f122e2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5119/becd0ba6a920de5bf02e8cdb9b2b5492e1f122e2/RabbitVCS.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
9342,
67,
3319,
67,
2854,
12,
2890,
16,
2893,
16,
2742,
16,
761,
4672,
3536,
9809,
14892,
603,
19014,
279,
1867,
18,
3998,
87,
819,
3824,
364,
1387,
3824,
471,
364,
2742,
5412... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
336,
67,
9342,
67,
3319,
67,
2854,
12,
2890,
16,
2893,
16,
2742,
16,
761,
4672,
3536,
9809,
14892,
603,
19014,
279,
1867,
18,
3998,
87,
819,
3824,
364,
1387,
3824,
471,
364,
2742,
5412... | |
self.evt_manager.showConfirmDialog("No " + self.stype + " shaders found!", "There were no " + self.s_type + "shaders found on the selected shader path!", None, False) | self.evt_manager.showConfirmDialog("No " + self.stype + " shaders found!", "There were no " + self.stype + "shaders found on the selected shader path!", None, False) | def makeShaderMenu(self): # get the current shader path print "Fetching shader data for ", self.stype, " shaders on path ", self.searchPaths.getValue() path = self.searchPaths.getValue() | 21d2bc48c8d049a163df549d2052804caf25f582 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11560/21d2bc48c8d049a163df549d2052804caf25f582/BtoRMain.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
19396,
4599,
12,
2890,
4672,
468,
336,
326,
783,
16700,
589,
1172,
315,
30806,
16700,
501,
364,
3104,
365,
18,
27273,
16,
315,
699,
361,
414,
603,
589,
3104,
365,
18,
3072,
4466,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1221,
19396,
4599,
12,
2890,
4672,
468,
336,
326,
783,
16700,
589,
1172,
315,
30806,
16700,
501,
364,
3104,
365,
18,
27273,
16,
315,
699,
361,
414,
603,
589,
3104,
365,
18,
3072,
4466,
... |
return S_OK(allReplicas) def getFilesFromDirectory(self,directory,days=0,wildcard='*'): if type(directory) in types.StringTypes: | return S_OK( allReplicas ) def getFilesFromDirectory( self, directory, days=0, wildcard='*' ): if type( directory ) in types.StringTypes: | def getReplicasFromDirectory(self,directory): if type(directory) in types.StringTypes: directories = [directory] else: directories = directory res = self.__getCatalogDirectoryContents(directories) if not res['OK']: return res allReplicas = {} for lfn,metadata in res['Value'].items(): allReplicas[lfn] = metadata['Replicas'] return S_OK(allReplicas) | 9fabceb719d19d46d8b75011d2932552dbe360f9 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/9fabceb719d19d46d8b75011d2932552dbe360f9/ReplicaManager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5561,
10528,
1265,
2853,
12,
2890,
16,
5149,
4672,
309,
618,
12,
5149,
13,
316,
1953,
18,
780,
2016,
30,
6402,
273,
306,
5149,
65,
469,
30,
6402,
273,
1867,
400,
273,
365,
16186,
588,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
5561,
10528,
1265,
2853,
12,
2890,
16,
5149,
4672,
309,
618,
12,
5149,
13,
316,
1953,
18,
780,
2016,
30,
6402,
273,
306,
5149,
65,
469,
30,
6402,
273,
1867,
400,
273,
365,
16186,
588,
... |
result = self._insert('OptimizerParameters',['JobID','Name','Value'],[jobID, key, value]) | result = self._insert('OptimizerParameters',['JobID','Name','Value'],[jobID, name, value]) | def setJobOptParameter(self,jobID,name,value): """ Set an optimzer parameter specified by name,value pair for the job JobID """ | bad582ec616dc164d713c18895d52287f3d628d6 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12864/bad582ec616dc164d713c18895d52287f3d628d6/JobDB.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
444,
2278,
6179,
1662,
12,
2890,
16,
4688,
734,
16,
529,
16,
1132,
4672,
3536,
1000,
392,
5213,
24355,
1569,
1269,
635,
508,
16,
1132,
3082,
364,
326,
1719,
22137,
3536,
2,
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,
444,
2278,
6179,
1662,
12,
2890,
16,
4688,
734,
16,
529,
16,
1132,
4672,
3536,
1000,
392,
5213,
24355,
1569,
1269,
635,
508,
16,
1132,
3082,
364,
326,
1719,
22137,
3536,
2,
-100,
-100,
... |
SyntaxError: 'return' with argument inside generator (<doctest test.test_generators.__test__.syntax[0]>, line 3) | File "<doctest test.test_generators.__test__.syntax[0]>", line 3 SyntaxError: 'return' with argument inside generator | >>> def f(): | 7db92d62c7af8b884af053bc3b481dfb627fe31d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6934/7db92d62c7af8b884af053bc3b481dfb627fe31d/test_generators.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
13332,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
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,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
4080,
1652,
284,
13332,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
except Exception: | except Exception, e: | def get_config(rnkMETHOD): #needs some work """Load common data into memory""" global stopwords global stemmer global chars_alphanumericseparators global col_size global rnkWORD_table languages = {'fr': 'french', 'en': 'porter', 'no':'norwegian', 'se':'swedish', 'de': 'german', 'it':'italian', 'pt':'portugese'} try: if stemmer and stopwords: pass except StandardError, e: rnkWORD_table = methods[rnkMETHOD]["rnkWORD_table"] try: if methods[rnkMETHOD].has_key("stem_lang"): stemmer = Stemmer.Stemmer(languages[[methods[rnkMETHOD]["stem_lang"]]]) else: stemmer = None except Exception: stemmer = None if methods[rnkMETHOD].has_key("stopword"): stopwords = get_stopwords("%s" % methods[rnkMETHOD]["stopword"]) else: stopwords = {} chars_alphanumericseparators = r"[1234567890\!\"\#\$\%\&\'\(\)\*\+\,\-\.\/\:\;\<\=\>\?\@\[\\\]\^\_\`\{\|\}\~]" col_size = run_sql("SELECT count(*) FROM %sR" % rnkWORD_table[:-1])[0][0] | 8a040ea1c4e2ba68a120c489d438fc9222a0144d /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12027/8a040ea1c4e2ba68a120c489d438fc9222a0144d/bibrank_record_sorter.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
1425,
12,
27639,
79,
5327,
4672,
468,
20600,
2690,
1440,
3536,
2563,
2975,
501,
1368,
3778,
8395,
2552,
2132,
3753,
2552,
13119,
6592,
2552,
5230,
67,
287,
21183,
11287,
87,
2552,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1425,
12,
27639,
79,
5327,
4672,
468,
20600,
2690,
1440,
3536,
2563,
2975,
501,
1368,
3778,
8395,
2552,
2132,
3753,
2552,
13119,
6592,
2552,
5230,
67,
287,
21183,
11287,
87,
2552,... |
else: | else: | def _configureParameter(p, value): """Configures the given ADO Parameter 'p' with the Python 'value'.""" if isinstance(value, (datetime.date, datetime.datetime, datetime.time)): #Known problem with JET Provider. Date can not be specified as a COM date. # See for example: # http://support.microsoft.com/default.aspx?scid=kb%3ben-us%3b284843 # One workaround is to provide the date as a string in the format 'YYYY-MM-dd' s = value.isoformat() # Hack to trim microseconds on iso dates down to 3 decimals try: # ... only if parameter is a datetime string s = rx_datetime.findall(s)[0] except: pass p.Value = s p.Size = len(s) elif isinstance(value, basestring): s = value # Hack to trim microseconds on iso dates down to 3 decimals try: # ... only if parameter is a datetime string s = rx_datetime.findall(s)[0] except: pass p.Value = s p.Size = len(s) elif isinstance(value, buffer): p.Size = len(value) p.AppendChunk(value) elif isinstance(value, decimal.Decimal): s = str(elem.normalize()) p.Value = elem p.Precision = len(s) point = s.find('.') if point == -1: p.NumericScale = 0 else: p.NumericScale = len(s)-point else: p.Value = value # Use -1 instead of 0 for empty strings and similar. if p.Size == 0: p.Size = -1 | 932ac550f3a72350d92bf3089014e79481193cb0 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1254/932ac550f3a72350d92bf3089014e79481193cb0/dbapi.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14895,
1662,
12,
84,
16,
460,
4672,
3536,
20323,
326,
864,
432,
3191,
5498,
296,
84,
11,
598,
326,
6600,
296,
1132,
11,
12123,
309,
1549,
12,
1132,
16,
261,
6585,
18,
712,
16,
3... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
14895,
1662,
12,
84,
16,
460,
4672,
3536,
20323,
326,
864,
432,
3191,
5498,
296,
84,
11,
598,
326,
6600,
296,
1132,
11,
12123,
309,
1549,
12,
1132,
16,
261,
6585,
18,
712,
16,
3... |
if p.decl.type.isToplevel(): | if dispatches: | def addDispatcher(mdefn, dispatchMethod, params): mdefn.addstmt(cxx.StmtDecl(cxx.Decl(cxx.Type('int'), '__route'))) routevar = cxx.ExprVar('__route') mdefn.addstmt(cxx.StmtExpr(cxx.ExprAssn( routevar, cxx.ExprCall(cxx.ExprSelect(cxx.ExprVar('msg'), '.', 'routing_id'))))) routeif = cxx.StmtIf(cxx.ExprBinary( cxx.ExprVar('MSG_ROUTING_CONTROL'), '!=', routevar)) routeif.ifb.addstmt(cxx.StmtDecl(cxx.Decl( cxx.Type('Channel::Listener', ptr=1), '__routed'))) routedvar = cxx.ExprVar('__routed') routeif.ifb.addstmt(cxx.StmtExpr(cxx.ExprAssn( routedvar, cxx.ExprCall(cxx.ExprVar('Lookup'), [ routevar ])))) | 134060c8d7f4987e8b617779d6063a1d7b5ff7a4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11102/134060c8d7f4987e8b617779d6063a1d7b5ff7a4/lower.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
527,
6681,
12,
81,
536,
82,
16,
3435,
1305,
16,
859,
4672,
312,
536,
82,
18,
1289,
10589,
12,
71,
5279,
18,
8952,
3456,
12,
71,
5279,
18,
3456,
12,
71,
5279,
18,
559,
2668,
474,
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,
527,
6681,
12,
81,
536,
82,
16,
3435,
1305,
16,
859,
4672,
312,
536,
82,
18,
1289,
10589,
12,
71,
5279,
18,
8952,
3456,
12,
71,
5279,
18,
3456,
12,
71,
5279,
18,
559,
2668,
474,
19... |
self.code = read_code(self.file) | self.code = read_jython_code(fullname, self.file, self.filename) | def get_code(self, fullname=None): fullname = self._fix_name(fullname) if self.code is None: mod_type = self.etc[2] if mod_type==imp.PY_SOURCE: source = self.get_source(fullname) self.code = compile(source, self.filename, 'exec') elif mod_type==imp.PY_COMPILED: self._reopen() try: self.code = read_code(self.file) finally: self.file.close() elif mod_type==imp.PKG_DIRECTORY: self.code = self._get_delegate().get_code() return self.code | 7c50b54dfee6db7bcd97441afc3dbeda114b4e88 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6753/7c50b54dfee6db7bcd97441afc3dbeda114b4e88/pkgutil.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
710,
12,
2890,
16,
13321,
33,
7036,
4672,
13321,
273,
365,
6315,
904,
67,
529,
12,
21885,
13,
309,
365,
18,
710,
353,
599,
30,
681,
67,
723,
273,
365,
18,
14175,
63,
22,
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,
336,
67,
710,
12,
2890,
16,
13321,
33,
7036,
4672,
13321,
273,
365,
6315,
904,
67,
529,
12,
21885,
13,
309,
365,
18,
710,
353,
599,
30,
681,
67,
723,
273,
365,
18,
14175,
63,
22,
6... |
while True: if self.max_requests and self.max_requests < requests_processed: self.logger.debug('Thread %s processed %i requests (limit %s); stopping thread' % (thread_id, requests_processed, self.max_requests)) try: self.idle_workers.remove(thread_id) except ValueError: pass self.add_worker_thread() return runnable = self.queue.get() if runnable is ThreadPool.SHUTDOWN: self.logger.debug('Worker %s asked to SHUTDOWN', thread_id) try: self.idle_workers.remove(thread_id) except ValueError: pass return else: | add_replacement_worker = False self.logger.debug('Started new worker %s: %s', thread_id, message) try: while True: if self.max_requests and self.max_requests < requests_processed: self.logger.debug('Thread %s processed %i requests (limit %s); stopping thread' % (thread_id, requests_processed, self.max_requests)) add_replacement_worker = True break runnable = self.queue.get() if runnable is ThreadPool.SHUTDOWN: self.logger.debug('Worker %s asked to SHUTDOWN', thread_id) break | def worker_thread_callback(self): """ Worker thread should call this method to get and process queued callables. """ thread_obj = threading.currentThread() thread_id = thread_obj.thread_id = thread.get_ident() self.idle_workers.append(thread_id) requests_processed = 0 while True: if self.max_requests and self.max_requests < requests_processed: # Replace this thread then die self.logger.debug('Thread %s processed %i requests (limit %s); stopping thread' % (thread_id, requests_processed, self.max_requests)) try: self.idle_workers.remove(thread_id) except ValueError: pass self.add_worker_thread() return runnable = self.queue.get() if runnable is ThreadPool.SHUTDOWN: self.logger.debug('Worker %s asked to SHUTDOWN', thread_id) try: self.idle_workers.remove(thread_id) except ValueError: pass return else: try: self.idle_workers.remove(thread_id) except ValueError: pass self.worker_tracker[thread_id] = [time.time(), None] requests_processed += 1 try: try: runnable() except: # We are later going to call sys.exc_clear(), # removing all remnants of any exception, so # we should log it now. But ideally no # exception should reach this level print >> sys.stderr, ( 'Unexpected exception in worker %r' % runnable) traceback.print_exc() finally: try: del self.worker_tracker[thread_id] except KeyError: pass sys.exc_clear() if thread_id in self.dying_threads: # This thread has been killed; so die! return self.idle_workers.append(thread_id) | 1a4a60600040d9f61e5bc617f380ebf3b4a36acf /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/11400/1a4a60600040d9f61e5bc617f380ebf3b4a36acf/httpserver.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4322,
67,
5930,
67,
3394,
12,
2890,
4672,
3536,
11016,
2650,
1410,
745,
333,
707,
358,
336,
471,
1207,
12234,
745,
1538,
18,
3536,
2650,
67,
2603,
273,
17254,
18,
2972,
3830,
1435,
2650,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4322,
67,
5930,
67,
3394,
12,
2890,
4672,
3536,
11016,
2650,
1410,
745,
333,
707,
358,
336,
471,
1207,
12234,
745,
1538,
18,
3536,
2650,
67,
2603,
273,
17254,
18,
2972,
3830,
1435,
2650,... |
return '%4d%02d%02d%02d%02d%02d'%(self.year, self.month, | return '%4d%02d%02d%02d%02d%f'%(self.year, self.month, | def serialise(self): return '%4d%02d%02d%02d%02d%02d'%(self.year, self.month, self.day, self.hour, self.minute, self.second) | ba7e589e2c5c6aeb9bd311d50693f075db0379dd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1906/ba7e589e2c5c6aeb9bd311d50693f075db0379dd/date.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2734,
784,
12,
2890,
4672,
327,
1995,
24,
72,
9,
3103,
72,
9,
3103,
72,
9,
3103,
72,
9,
3103,
72,
9,
74,
11,
17105,
2890,
18,
6874,
16,
365,
18,
7496,
16,
365,
18,
2881,
16,
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,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2734,
784,
12,
2890,
4672,
327,
1995,
24,
72,
9,
3103,
72,
9,
3103,
72,
9,
3103,
72,
9,
3103,
72,
9,
74,
11,
17105,
2890,
18,
6874,
16,
365,
18,
7496,
16,
365,
18,
2881,
16,
365,... |
LL0 = math.exp(math.exp(dx / SCALE) / 1000) | LL0 = exp(exp(dx / SCALE) / 1000) | def _calc_log_log(dx): """ LL0 scale """ if dx < 0: dx += SWIDTH - (2.0 * OFFSET) LL0 = math.exp(math.exp(dx / SCALE) / 1000) if LL0 > 1.002: return round(LL0, 5) else: return round(LL0, 6) | 5fa09bcbc8e023850510305ca87bc00a475677be /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5595/5fa09bcbc8e023850510305ca87bc00a475677be/window.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12448,
67,
1330,
67,
1330,
12,
13437,
4672,
3536,
29863,
20,
3159,
3536,
309,
6633,
411,
374,
30,
6633,
1011,
348,
10023,
300,
261,
22,
18,
20,
380,
26019,
13,
29863,
20,
273,
132... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
12448,
67,
1330,
67,
1330,
12,
13437,
4672,
3536,
29863,
20,
3159,
3536,
309,
6633,
411,
374,
30,
6633,
1011,
348,
10023,
300,
261,
22,
18,
20,
380,
26019,
13,
29863,
20,
273,
132... |
0.92387953251128674), (2.1598449493429825, 0.83146961230254546), | 0.92387953251128674), (2.1598449493429825, 0.831469612302545...), | def generate_plot_points(f, xrange, plot_points=5, adaptive_tolerance=0.01, adaptive_recursion=5, randomize = True): r""" Calculate plot points for a function f in the interval xrange. The adaptive refinement algorithm for plotting a function f. See the docstring for plot for a description of the algorithm. INPUT: f -- a function of one variable p1, p2 -- two points to refine between plot_points -- (default: 5) the minimal number of plot points. adaptive_recursion -- (default: 5) how many levels of recursion to go before giving up when doing adaptive refinement. Setting this to 0 disables adaptive refinement. adaptive_tolerance -- (default: 0.01) how large a difference should be before the adaptive refinement code considers it significant. See the documentation for plot() for more information. OUTPUT: list -- a list of points (x, f(x)) in the interval xrange, which aproximate the function f. TESTS: sage: from sage.plot.plot import generate_plot_points sage: generate_plot_points(sin, (0, pi), plot_points=2, adaptive_recursion=0) [(0.0, 0.0), (3.1415926535897931, 1.2246...e-16)] sage: generate_plot_points(sin(x), (-pi, pi), randomize=False) [(-3.1415926535897931, -1.2246...e-16), (-2.748893571891069, -0.38268343236508989), (-2.3561944901923448, -0.707106781186547...), (-2.1598449493429825, -0.83146961230254546), (-1.9634954084936207, -0.92387953251128674), (-1.7671458676442586, -0.98078528040323043), (-1.5707963267948966, -1.0), (-1.3744467859455345, -0.98078528040323043), (-1.1780972450961724, -0.92387953251128674), (-0.98174770424681035, -0.83146961230254524), (-0.78539816339744828, -0.707106781186547...), (-0.39269908169872414, -0.38268343236508978), (0.0, 0.0), (0.39269908169872414, 0.38268343236508978), (0.78539816339744828, 0.707106781186547...), (0.98174770424681035, 0.83146961230254524), (1.1780972450961724, 0.92387953251128674), (1.3744467859455345, 0.98078528040323043), (1.5707963267948966, 1.0), (1.7671458676442586, 0.98078528040323043), (1.9634954084936207, 0.92387953251128674), (2.1598449493429825, 0.83146961230254546), (2.3561944901923448, 0.707106781186547...), (2.748893571891069, 0.38268343236508989), (3.1415926535897931, 1.2246...e-16)] This shows that lowering adaptive_tolerance and raising adaptive_recursion both increase the number of subdivision points: sage: x = var('x') sage: f = sin(1/x) sage: [len(generate_plot_points(f, (-pi, pi), adaptive_tolerance=i)) for i in [0.01, 0.001, 0.0001]] [42, 67, 104] sage: [len(generate_plot_points(f, (-pi, pi), adaptive_recursion=i)) for i in [5, 10, 15]] [34, 144, 897] """ x, data = var_and_list_of_values(xrange, plot_points) xmin = data[0] xmax = data[-1] delta = float(xmax-xmin) / plot_points random = current_randstate().python_random().random exceptions = 0; msg='' exception_indices = [] for i in range(len(data)): xi = data[i] # Slightly randomize the interior sample points if # randomize is true if randomize and i > 0 and i < plot_points-1: xi += delta*(random() - 0.5) try: data[i] = (float(xi), float(f(xi))) if str(data[i][1]) in ['nan', 'NaN', 'inf', '-inf']: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) exceptions += 1 exception_indices.append(i) except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: sage.misc.misc.verbose("%s\nUnable to compute f(%s)"%(msg, x),1) if i == 0: for j in range(1, 99): xj = xi + delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) elif i == plot_points-1: for j in range(1, 99): xj = xi - delta*j/100.0 try: data[i] = (float(xj), float(f(xj))) # nan != nan if data[i][1] != data[i][1]: continue break except (ZeroDivisionError, TypeError, ValueError, OverflowError), msg: pass else: exceptions += 1 exception_indices.append(i) else: exceptions += 1 exception_indices.append(i) exceptions += 1 exception_indices.append(i) data = [data[i] for i in range(len(data)) if i not in exception_indices] # adaptive refinement i, j = 0, 0 adaptive_tolerance = delta * float(adaptive_tolerance) adaptive_recursion = int(adaptive_recursion) while i < len(data) - 1: for p in adaptive_refinement(f, data[i], data[i+1], adaptive_tolerance=adaptive_tolerance, adaptive_recursion=adaptive_recursion): data.insert(i+1, p) i += 1 i += 1 if (len(data) == 0 and exceptions > 0) or exceptions > 10: sage.misc.misc.verbose("WARNING: When plotting, failed to evaluate function at %s points."%exceptions, level=0) sage.misc.misc.verbose("Last error message: '%s'"%msg, level=0) return data | fcff82c919cb4ddf038cc5c9ed2026a986eb7cba /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/fcff82c919cb4ddf038cc5c9ed2026a986eb7cba/plot.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2103,
67,
4032,
67,
4139,
12,
74,
16,
12314,
16,
3207,
67,
4139,
33,
25,
16,
5855,
688,
67,
25456,
33,
20,
18,
1611,
16,
5855,
688,
67,
31347,
33,
25,
16,
2744,
554,
273,
1053,
467... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4032,
67,
4139,
12,
74,
16,
12314,
16,
3207,
67,
4139,
33,
25,
16,
5855,
688,
67,
25456,
33,
20,
18,
1611,
16,
5855,
688,
67,
31347,
33,
25,
16,
2744,
554,
273,
1053,
467... |
self.self.ui.ca.gplay.pause() | self.ui.ca.gplay.pause() | def _scaleButtonPressCb(self, widget, event): self.button.set_sensitive(False) self.was_playing = self.ui.ca.gplay.is_playing() if self.was_playing: self.self.ui.ca.gplay.pause() | 10cc2ef37562e3e045f045772d4775f8ed3bdfcb /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/6451/10cc2ef37562e3e045f045772d4775f8ed3bdfcb/ui.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
5864,
3616,
11840,
15237,
12,
2890,
16,
3604,
16,
871,
4672,
365,
18,
5391,
18,
542,
67,
23481,
12,
8381,
13,
365,
18,
17416,
67,
1601,
310,
273,
365,
18,
4881,
18,
5353,
18,
75... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
5864,
3616,
11840,
15237,
12,
2890,
16,
3604,
16,
871,
4672,
365,
18,
5391,
18,
542,
67,
23481,
12,
8381,
13,
365,
18,
17416,
67,
1601,
310,
273,
365,
18,
4881,
18,
5353,
18,
75... |
m = float(y1 - y0 + 0.00000001) / float(x1 - x0 + 0.00000001) mi = 1.0 / m | dx = float(x1 - x0) dy = float(y1 - y0) if dx != 0.0: m = dy / dx else: m = 0.0 if dy != 0.0: mi = dx / dy else: mi = 0.0 | def outCode(x, y, xmin, ymin, xmax, ymax): | 9e39c9362fdd9bb7a85c232b76d53aa15f4be1e5 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/4494/9e39c9362fdd9bb7a85c232b76d53aa15f4be1e5/graph_editor.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
596,
1085,
12,
92,
16,
677,
16,
13777,
16,
15763,
16,
14016,
16,
15275,
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,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
596,
1085,
12,
92,
16,
677,
16,
13777,
16,
15763,
16,
14016,
16,
15275,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
print 'Usage: %s <username>+' %(Script.scriptName) DIRAC.exit(2) | print 'Usage: %s <username>+' % ( Script.scriptName ) DIRAC.exit( 2 ) | def usage(): print 'Usage: %s <username>+' %(Script.scriptName) DIRAC.exit(2) | fb890b0396e41d848e4e34d789bee03f2d84162d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12864/fb890b0396e41d848e4e34d789bee03f2d84162d/dirac-admin-delete-user.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
5053,
34,
6797,
738,
261,
7739,
18,
4263,
461,
262,
18544,
2226,
18,
8593,
12,
576,
262,
282,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4084,
13332,
1172,
296,
5357,
30,
738,
87,
411,
5053,
34,
6797,
738,
261,
7739,
18,
4263,
461,
262,
18544,
2226,
18,
8593,
12,
576,
262,
282,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
"'ascii' codec can't encode character '\\xfc' in position 1: ouch" | "'ascii' codec can't encode character u'\\xfc' in position 1: ouch" | def test_unicodeencodeerror(self): self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 2, "ouch"], "'ascii' codec can't encode character '\\xfc' in position 1: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"g\xfcrk", 1, 4, "ouch"], "'ascii' codec can't encode characters in position 1-3: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\xfcx", 0, 1, "ouch"], "'ascii' codec can't encode character '\\xfc' in position 0: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\u0100x", 0, 1, "ouch"], "'ascii' codec can't encode character '\\u0100' in position 0: ouch" ) self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\uffffx", 0, 1, "ouch"], "'ascii' codec can't encode character '\\uffff' in position 0: ouch" ) if sys.maxunicode > 0xffff: self.check_exceptionobjectargs( UnicodeEncodeError, ["ascii", u"\U00010000x", 0, 1, "ouch"], "'ascii' codec can't encode character '\\U00010000' in position 0: ouch" ) | a54b92b2ebcbaaa4b7f77ff411a73a820522a67b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/a54b92b2ebcbaaa4b7f77ff411a73a820522a67b/test_codeccallbacks.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9124,
3015,
1636,
12,
2890,
4672,
365,
18,
1893,
67,
4064,
1612,
1968,
12,
9633,
5509,
668,
16,
8247,
9184,
3113,
582,
6,
75,
64,
5841,
3353,
79,
3113,
404,
16,
576,
16,
31... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
9124,
3015,
1636,
12,
2890,
4672,
365,
18,
1893,
67,
4064,
1612,
1968,
12,
9633,
5509,
668,
16,
8247,
9184,
3113,
582,
6,
75,
64,
5841,
3353,
79,
3113,
404,
16,
576,
16,
31... |
plotter = Gnuplot.Gnuplot() | plotter = Gnuplot.Gnuplot(debug=1) | def plotStreams(self, groupAddrs, genImage=""): | 9d593b5859483a776f3e59e9f769c2e4383fa8d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10061/9d593b5859483a776f3e59e9f769c2e4383fa8d4/knxmonitor_decoder.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
3207,
10301,
12,
2890,
16,
1041,
13811,
16,
3157,
2040,
1546,
6,
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,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
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,
3207,
10301,
12,
2890,
16,
1041,
13811,
16,
3157,
2040,
1546,
6,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... |
self.Blocked = False | self.Block = 0 | def __init__(self, main, context): self.Context = context self.Main = main self.Blocked = False rightChild = gtk.VBox() rightChild.set_border_width(10) # Auto sort autoSort = gtk.CheckButton(_("Automatic plugin sorting")) rightChild.pack_start(autoSort, False, False, 10) # Lists listBox = gtk.HBox() listBox.set_spacing(5) | 6f4218a1b08599528067ac7eefd8b2769245e620 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/1272/6f4218a1b08599528067ac7eefd8b2769245e620/Pages.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2774,
16,
819,
4672,
365,
18,
1042,
273,
819,
365,
18,
6376,
273,
2774,
365,
18,
1768,
273,
374,
2145,
1763,
273,
22718,
18,
58,
3514,
1435,
2145,
1763,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2774,
16,
819,
4672,
365,
18,
1042,
273,
819,
365,
18,
6376,
273,
2774,
365,
18,
1768,
273,
374,
2145,
1763,
273,
22718,
18,
58,
3514,
1435,
2145,
1763,
... |
pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1, | pop = subprocess.Popen((prog,) + args, bufsize= -1, | def exec_pg_command_pipe(name, *args): prog = find_pg_tool(name) if not prog: raise Exception('Couldn\'t find %s' % name) pop = subprocess.Popen(args, executable=prog, shell=True, bufsize= -1, stdin=subprocess.PIPE, stdout=subprocess.PIPE, close_fds=True) return (pop.stdin, pop.stdout) | 410c1ff7a5b21444aa769b11d968f60c566a18f1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/410c1ff7a5b21444aa769b11d968f60c566a18f1/misc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1196,
67,
8365,
67,
3076,
67,
14772,
12,
529,
16,
380,
1968,
4672,
11243,
273,
1104,
67,
8365,
67,
6738,
12,
529,
13,
309,
486,
11243,
30,
1002,
1185,
2668,
16342,
3730,
88,
1104,
738,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1196,
67,
8365,
67,
3076,
67,
14772,
12,
529,
16,
380,
1968,
4672,
11243,
273,
1104,
67,
8365,
67,
6738,
12,
529,
13,
309,
486,
11243,
30,
1002,
1185,
2668,
16342,
3730,
88,
1104,
738,... |
file.Write(" | file.Write("#undef GLES2_CMD_OP\n") | dba915f7e61bdcf68079b251ae5822ed80436083 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/5060/dba915f7e61bdcf68079b251ae5822ed80436083/build_gles2_cmd_buffer.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
585,
18,
3067,
2932,
7,
318,
536,
611,
11386,
22,
67,
19473,
67,
3665,
64,
82,
7923,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
585,
18,
3067,
2932,
7,
318,
536,
611,
11386,
22,
67,
19473,
67,
3665,
64,
82,
7923,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
... | |
'max_events' : SimpleItem(defvalue='',doc='Maximum number of events'), | 'max_events' : SimpleItem(defvalue=-1, typelist=['int'], doc='Maximum number of events'), | def __init__(self): super(AthenaOutputDataset,self).__init__() | c48aac6b648f36049b36bca633e5bf419b15ff2c /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/1488/c48aac6b648f36049b36bca633e5bf419b15ff2c/Athena.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
37,
15991,
69,
1447,
10656,
16,
2890,
2934,
972,
2738,
972,
1435,
225,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
4672,
2240,
12,
37,
15991,
69,
1447,
10656,
16,
2890,
2934,
972,
2738,
972,
1435,
225,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-10... |
Returns some generators of this elliptic curve. Check rank or rank_bound to verify the number of generators. | Returns some generators of this elliptic curve. Check :meth:`~rank` or :meth:`~rank_bounds` to verify the number of generators. .. NOTE:: The optional parameters control the Simon two descent algorithm; see the documentation of :meth:`~simon_two_descent` for more details. | def gens(self,verbose=0, lim1=5, lim3=50, limtriv=10, maxprob=20, limbigprime=30): r""" Returns some generators of this elliptic curve. Check rank or rank_bound to verify the number of generators. | 650f1818f624820481186d5c23dd6c8792ace92e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/650f1818f624820481186d5c23dd6c8792ace92e/ell_number_field.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
773,
12,
2890,
16,
11369,
33,
20,
16,
20167,
21,
33,
25,
16,
20167,
23,
33,
3361,
16,
20167,
313,
427,
33,
2163,
16,
943,
7748,
33,
3462,
16,
20167,
14002,
16382,
33,
5082,
4672... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
314,
773,
12,
2890,
16,
11369,
33,
20,
16,
20167,
21,
33,
25,
16,
20167,
23,
33,
3361,
16,
20167,
313,
427,
33,
2163,
16,
943,
7748,
33,
3462,
16,
20167,
14002,
16382,
33,
5082,
4672... |
sage: L = add([line([[pf[0][0],0],[pf[0][0],pf[1](pf[0][0])]],rgbcolor=(0.7,0.6,0.6)) for pf in rsf.list()]) | sage: L = add([line([[pf[0][0],0],[pf[0][0],pf[1](x=pf[0][0])]],rgbcolor=(0.7,0.6,0.6)) for pf in rsf.list()]) | def riemann_sum(self,N,mode=None): """ Returns the piecewise line function defined by the Riemann sums in numerical integration based on a subdivision into N subintervals. | b776517f80fe442e7a194ad06dcaca55ca737d4b /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9417/b776517f80fe442e7a194ad06dcaca55ca737d4b/piecewise.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
12347,
351,
1072,
67,
1364,
12,
2890,
16,
50,
16,
3188,
33,
7036,
4672,
3536,
2860,
326,
11151,
2460,
980,
445,
2553,
635,
326,
21688,
351,
1072,
26608,
316,
17409,
12040,
2511,
603,
279... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
12347,
351,
1072,
67,
1364,
12,
2890,
16,
50,
16,
3188,
33,
7036,
4672,
3536,
2860,
326,
11151,
2460,
980,
445,
2553,
635,
326,
21688,
351,
1072,
26608,
316,
17409,
12040,
2511,
603,
279... |
if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(args), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(args)), try: result = formatstr % args except OverflowError: if verbose: print 'overflow (this is fine)' else: if output and result != output: if verbose: print 'no' print "%s %% %s == %s != %s" %\ (repr(formatstr), repr(args), repr(result), repr(output)) else: if verbose: print 'yes' | if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(args), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(args)), try: result = formatstr % args except OverflowError: if not overflowok: raise if verbose: print 'overflow (this is fine)' else: if output and result != output: if verbose: print 'no' print "%s %% %s == %s != %s" %\ (repr(formatstr), repr(args), repr(result), repr(output)) else: if verbose: print 'yes' | def testformat(formatstr, args, output=None): if verbose: if output: print "%s %% %s =? %s ..." %\ (repr(formatstr), repr(args), repr(output)), else: print "%s %% %s works? ..." % (repr(formatstr), repr(args)), try: result = formatstr % args except OverflowError: if verbose: print 'overflow (this is fine)' else: if output and result != output: if verbose: print 'no' print "%s %% %s == %s != %s" %\ (repr(formatstr), repr(args), repr(result), repr(output)) else: if verbose: print 'yes' | 38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/38fd5b641366eedc74e4be3a0e4d2210f3bcdb5a/test_format.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
2139,
12,
2139,
701,
16,
833,
16,
876,
33,
7036,
4672,
309,
3988,
30,
309,
876,
30,
1172,
2213,
87,
26510,
738,
87,
273,
35,
738,
87,
18483,
738,
64,
261,
12715,
12,
2139,
701,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2139,
12,
2139,
701,
16,
833,
16,
876,
33,
7036,
4672,
309,
3988,
30,
309,
876,
30,
1172,
2213,
87,
26510,
738,
87,
273,
35,
738,
87,
18483,
738,
64,
261,
12715,
12,
2139,
701,... |
''' | >>> X = '<s1 id="XYZ" title="XYZ"><s2 id="1" title="1"><ul><li><p>WikiLink </p></li></ul><p/></s2><s2 id="1" title="1"><ul><li>Wikilink </li></ul><p/></s2></s1>' >>> doc = parse(X) >>> simple_struct(doc) [(u'XYZ', [(u'1', [[u'WikiLink ']]), (u'1', [[u'Wikilink ']])])] ''' | def simple_struct(node): ''' >>> from amara.bindery import parse >>> from zenlib.moinmodel import simple_struct >>> X = '<s2 id="XYZ" title="XYZ"><p/><s3 id="A" title="A"><p>Hello</p><s4 id="AB" title="AB"><p>World</p></s4></s3></s2>' >>> doc = parse(X) >>> simple_struct(doc) [(u'XYZ', [(u'A', [u'Hello', (u'AB', [u'World'])])])] >>> X = '<s2 id="XYZ" title="XYZ"><p/><s3 id="A" title="A"><p>Hello</p><s4 id="AB" title="AB"><gloss><label>spam</label><item>eggs</item></gloss></s4></s3></s2>' >>> doc = parse(X) >>> simple_struct(doc) [(u'XYZ', [(u'A', [u'Hello', (u'AB', [{u'spam': u'eggs'}])])])] ''' if not node: return None if len(node.xml_children) == 1 and not isinstance(node.xml_first_child, tree.element): return node.xml_first_child.xml_value top = [] for child in node.xml_elements: handler = structure_handlers.get(child.xml_local, U) result = handler(child) if not isinstance(result, basestring) or result.strip(): top.append(result) #logger.debug("simple_struct: " + repr(top)) #if len(top) == 1: top = top[0] return top | 9e2cec14f90ec63c89e67333f1bff5c1393471d0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7225/9e2cec14f90ec63c89e67333f1bff5c1393471d0/moinmodel.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4143,
67,
1697,
12,
2159,
4672,
225,
4080,
1139,
273,
2368,
87,
21,
612,
1546,
23479,
6,
2077,
1546,
23479,
14050,
87,
22,
612,
1546,
21,
6,
2077,
1546,
21,
14050,
332,
4438,
549,
4438... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4143,
67,
1697,
12,
2159,
4672,
225,
4080,
1139,
273,
2368,
87,
21,
612,
1546,
23479,
6,
2077,
1546,
23479,
14050,
87,
22,
612,
1546,
21,
6,
2077,
1546,
21,
14050,
332,
4438,
549,
4438... |
from test.test_support import run_doctest | from test.test_support import run_doctest, run_unittest | def test_main(verbose=None): from test.test_support import run_doctest from test import test_code run_doctest(test_code, verbose) | b532c3636e330b88d9392d75c6e1985503cf4d53 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12029/b532c3636e330b88d9392d75c6e1985503cf4d53/test_code.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
5254,
12,
11369,
33,
7036,
4672,
628,
1842,
18,
3813,
67,
13261,
1930,
1086,
67,
2896,
299,
395,
16,
1086,
67,
4873,
3813,
628,
1842,
1930,
1842,
67,
710,
1086,
67,
2896,
299... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
1842,
67,
5254,
12,
11369,
33,
7036,
4672,
628,
1842,
18,
3813,
67,
13261,
1930,
1086,
67,
2896,
299,
395,
16,
1086,
67,
4873,
3813,
628,
1842,
1930,
1842,
67,
710,
1086,
67,
2896,
299... |
wx.CallAfter(lambda: self.after_external_edit_text(new_sexpr, dialog, exception)) | wx.CallAfter(lambda: self.after_external_edit_text(new_sexpr, disabler, exception)) | def job(sexpr, dialog): new_sexpr = None try: tmp_file = tempfile.NamedTemporaryFile() try: text_mangle.export(sexpr, tmp_file) tmp_file.flush() external_edit(tmp_file.name) tmp_file.seek(0) try: new_sexpr = text_mangle.import_(sexpr, tmp_file) except text_mangle.NothingChanged: pass finally: tmp_file.close() except Exception, exception: pass else: exception = None wx.CallAfter(lambda: self.after_external_edit_text(new_sexpr, dialog, exception)) | 4b778a1217d0e22606153d31f569f9b5c2bb95ce /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/3683/4b778a1217d0e22606153d31f569f9b5c2bb95ce/main.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1719,
12,
20909,
683,
16,
6176,
4672,
394,
67,
20909,
683,
273,
599,
775,
30,
1853,
67,
768,
273,
13275,
18,
7604,
23808,
1435,
775,
30,
977,
67,
81,
4341,
18,
6530,
12,
20909,
683,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1719,
12,
20909,
683,
16,
6176,
4672,
394,
67,
20909,
683,
273,
599,
775,
30,
1853,
67,
768,
273,
13275,
18,
7604,
23808,
1435,
775,
30,
977,
67,
81,
4341,
18,
6530,
12,
20909,
683,
... |
call([vs_cmd, solution_path, '/rebuild', 'Release'], shell=True) | call([vs_cmd, solution_path, '/rebuild', 'MinSizeRel'], shell=True) | def build_libraries(): """Builds library targets: expat, scew and pcre.""" vs_cmd = get_vs_ide_bin() cur_path = os.getcwd() print 'Build expat library...' solution_path = os.path.join(cur_path, 'Externals/expat/lib/expat.vcproj') #print solution_path call([vs_cmd, solution_path, '/rebuild', 'Release'], shell=True) print 'Build scew library...' solution_path = os.path.join(cur_path, 'Externals/scew/win32/scew.vcproj') #print solution_path call([vs_cmd, solution_path, '/rebuild', 'Release'], shell=True) print 'Build pcre library...' solution_path = os.path.join(cur_path, 'Externals/pcre/dll_pcre/pcre.vcproj') #print solution_path call([vs_cmd, solution_path, '/rebuild', 'Release'], shell=True) | 3fa32bb987359daf44a432f9d024ed07a5b8b96b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5344/3fa32bb987359daf44a432f9d024ed07a5b8b96b/create_release.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
31417,
13332,
3536,
7746,
5313,
5774,
30,
1329,
270,
16,
272,
311,
91,
471,
293,
1793,
12123,
225,
6195,
67,
4172,
273,
336,
67,
6904,
67,
831,
67,
4757,
1435,
662,
67,
803,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1361,
67,
31417,
13332,
3536,
7746,
5313,
5774,
30,
1329,
270,
16,
272,
311,
91,
471,
293,
1793,
12123,
225,
6195,
67,
4172,
273,
336,
67,
6904,
67,
831,
67,
4757,
1435,
662,
67,
803,
... |
message = 'X-Mailer header detected, a loop is likely' LOG('MailBoxer', PROBLEM, message) | message = '%s (%s): X-Mailer header detected, a loop is '\ 'likely' % (self.getProperty('title', ''), self.getId()) log.error(message) | def checkMail(self, REQUEST): # Check for ip, loops and spam. # Check for correct IP mtahosts = self.getValueFor('mtahosts') if mtahosts: if 'HTTP_X_FORWARDED_FOR' in self.REQUEST.environ.keys(): REMOTE_IP = self.REQUEST.environ['HTTP_X_FORWARDED_FOR'] else: REMOTE_IP = self.REQUEST.environ['REMOTE_ADDR'] | 022876f88e927316bd924ded9b9dc1cbc88f4167 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/6274/022876f88e927316bd924ded9b9dc1cbc88f4167/XWFMailingList.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
866,
6759,
12,
2890,
16,
12492,
4672,
468,
2073,
364,
2359,
16,
14075,
471,
24824,
18,
225,
468,
2073,
364,
3434,
2971,
312,
2351,
11588,
273,
365,
18,
24805,
1290,
2668,
1010,
69,
11588... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
6759,
12,
2890,
16,
12492,
4672,
468,
2073,
364,
2359,
16,
14075,
471,
24824,
18,
225,
468,
2073,
364,
3434,
2971,
312,
2351,
11588,
273,
365,
18,
24805,
1290,
2668,
1010,
69,
11588... |
eval_ctx['datetime'] = datetime | def __init__(self, window, attrs=None): self.act_id = int(attrs['name']) self._window = window self.screen = None self.tree = None | eeb0c8c8fb0f2e1e50e9efcf641ff30642e4e8fa /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9151/eeb0c8c8fb0f2e1e50e9efcf641ff30642e4e8fa/action.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2742,
16,
3422,
33,
7036,
4672,
365,
18,
621,
67,
350,
273,
509,
12,
7039,
3292,
529,
19486,
365,
6315,
5668,
273,
2742,
365,
18,
9252,
273,
599,
365,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
2738,
972,
12,
2890,
16,
2742,
16,
3422,
33,
7036,
4672,
365,
18,
621,
67,
350,
273,
509,
12,
7039,
3292,
529,
19486,
365,
6315,
5668,
273,
2742,
365,
18,
9252,
273,
599,
365,
... | |
def _sigma(values): return math.sqrt(_variance(values)) | def test_split_words(self): self.assertEquals(lipsum._split_words("One two three four"), ["One", "two", "three", "four"]) self.assertEquals(lipsum._split_words(" One two three four "), ["One", "two", "three", "four"]) | def _sigma(values): return math.sqrt(_variance(values)) | fa9e6662a1f30cb272942f25e233798ee7edac45 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3480/fa9e6662a1f30cb272942f25e233798ee7edac45/testlipsum.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1842,
67,
4939,
67,
3753,
12,
2890,
4672,
365,
18,
11231,
8867,
12,
11693,
379,
6315,
4939,
67,
3753,
2932,
3335,
2795,
8925,
12792,
6,
3631,
8247,
3335,
3113,
315,
15415,
3113,
315,
451... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
4939,
67,
3753,
12,
2890,
4672,
365,
18,
11231,
8867,
12,
11693,
379,
6315,
4939,
67,
3753,
2932,
3335,
2795,
8925,
12792,
6,
3631,
8247,
3335,
3113,
315,
15415,
3113,
315,
451... |
'authname': p.get_authname(), 'authemail': p.get_authemail(), | 'fromauth': fromauth, 'authname': authname, 'authemail': authemail, | def __build_message(tmpl, patch, patch_nr, total_nr, msg_id, ref_id, options): """Build the message to be sent via SMTP """ p = crt_series.get_patch(patch) descr = p.get_description().strip() descr_lines = descr.split('\n') short_descr = descr_lines[0].rstrip() long_descr = '\n'.join(descr_lines[1:]).lstrip() maintainer = __get_maintainer() if not maintainer: maintainer = '%s <%s>' % (p.get_commname(), p.get_commemail()) if options.version: version_str = ' %s' % options.version else: version_str = '' if options.prefix: prefix_str = options.prefix + ' ' else: prefix_str = '' total_nr_str = str(total_nr) patch_nr_str = str(patch_nr).zfill(len(total_nr_str)) if total_nr > 1: number_str = ' %s/%s' % (patch_nr_str, total_nr_str) else: number_str = '' tmpl_dict = {'patch': patch, 'maintainer': maintainer, 'shortdescr': short_descr, 'longdescr': long_descr, # for backward template compatibility 'endofheaders': '', 'diff': git.diff(rev1 = git_id('%s//bottom' % patch), rev2 = git_id('%s//top' % patch)), 'diffstat': git.diffstat(rev1 = git_id('%s//bottom'%patch), rev2 = git_id('%s//top' % patch)), # for backward template compatibility 'date': '', 'version': version_str, 'prefix': prefix_str, 'patchnr': patch_nr_str, 'totalnr': total_nr_str, 'number': number_str, 'authname': p.get_authname(), 'authemail': p.get_authemail(), 'authdate': p.get_authdate(), 'commname': p.get_commname(), 'commemail': p.get_commemail()} # change None to '' for key in tmpl_dict: if not tmpl_dict[key]: tmpl_dict[key] = '' try: msg_string = tmpl % tmpl_dict except KeyError, err: raise CmdException, 'Unknown patch template variable: %s' \ % err except TypeError: raise CmdException, 'Only "%(name)s" variables are ' \ 'supported in the patch template' if options.edit_patches: msg_string = __edit_message(msg_string) # The Python email message try: msg = email.message_from_string(msg_string) except Exception, ex: raise CmdException, 'template parsing error: %s' % str(ex) if options.auto: extra_cc = __get_signers_list(descr) else: extra_cc = [] __build_address_headers(msg, options, extra_cc) __build_extra_headers(msg, msg_id, ref_id) __encode_message(msg) msg_string = msg.as_string(options.mbox) return msg_string.strip('\n') | 1d1485c3cb6799f561df780e8f142b0c54b8178b /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12366/1d1485c3cb6799f561df780e8f142b0c54b8178b/mail.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1001,
3510,
67,
2150,
12,
24717,
16,
4729,
16,
4729,
67,
11611,
16,
2078,
67,
11611,
16,
1234,
67,
350,
16,
1278,
67,
350,
16,
702,
4672,
3536,
3116,
326,
883,
358,
506,
3271,
3970,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
3510,
67,
2150,
12,
24717,
16,
4729,
16,
4729,
67,
11611,
16,
2078,
67,
11611,
16,
1234,
67,
350,
16,
1278,
67,
350,
16,
702,
4672,
3536,
3116,
326,
883,
358,
506,
3271,
3970,
... |
self._uid_to_label(cls)) | self._uid_to_label(base)) | def _inheritance_list_line(self, links, cls): # Group the objects by defining class inh_dict = {} for link in links: if isinstance(link, Link): key = link.target().cls() else: key = link.uid().cls() if key == cls: continue if key is None: continue if not inh_dict.has_key(key): inh_dict[key] = [] inh_dict[key].append(link) | e661539843a9b44dcadb2bd58348bfe0e2a6cb72 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11420/e661539843a9b44dcadb2bd58348bfe0e2a6cb72/latex.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6018,
1359,
67,
1098,
67,
1369,
12,
2890,
16,
4716,
16,
2028,
4672,
468,
3756,
326,
2184,
635,
9364,
667,
316,
76,
67,
1576,
273,
2618,
364,
1692,
316,
4716,
30,
309,
1549,
12,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
6018,
1359,
67,
1098,
67,
1369,
12,
2890,
16,
4716,
16,
2028,
4672,
468,
3756,
326,
2184,
635,
9364,
667,
316,
76,
67,
1576,
273,
2618,
364,
1692,
316,
4716,
30,
309,
1549,
12,
... |
def section(self, title, source, style, lineno): | def section(self, title, source, style, lineno, messages): | def section(self, title, source, style, lineno): """Check for a valid subsection and create one if it checks out.""" if self.check_subsection(source, style, lineno): self.new_subsection(title, lineno) | 3b276ab058f6fea3778175ae2d6e97f9f883e4ca /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5620/3b276ab058f6fea3778175ae2d6e97f9f883e4ca/states.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
12,
2890,
16,
2077,
16,
1084,
16,
2154,
16,
7586,
16,
2743,
4672,
3536,
1564,
364,
279,
923,
720,
3464,
471,
752,
1245,
309,
518,
4271,
596,
12123,
309,
365,
18,
1893,
67,
1717,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
2442,
12,
2890,
16,
2077,
16,
1084,
16,
2154,
16,
7586,
16,
2743,
4672,
3536,
1564,
364,
279,
923,
720,
3464,
471,
752,
1245,
309,
518,
4271,
596,
12123,
309,
365,
18,
1893,
67,
1717,
... |
print "Redirected to", nurl | print " Redirected to", nurl | def getpage(self, url): | 49c1d7a6b49af39c5d7de8a5110d55cf73e00e82 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/49c1d7a6b49af39c5d7de8a5110d55cf73e00e82/webchecker.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
2433,
12,
2890,
16,
880,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
2433,
12,
2890,
16,
880,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,... |
raise Errors.HeaderParseError( "Not a header, not a continuation: ``%s''"%line) | firstbodyline = line break | def _parseheaders(self, container, fp): # Parse the headers, returning a list of header/value pairs. None as # the header means the Unix-From header. lastheader = '' lastvalue = [] lineno = 0 while True: # Don't strip the line before we test for the end condition, # because whitespace-only header lines are RFC compliant # continuation lines. line = fp.readline() if not line: break line = line.splitlines()[0] if not line: break # Ignore the trailing newline lineno += 1 # Check for initial Unix From_ line if line.startswith('From '): if lineno == 1: container.set_unixfrom(line) continue elif self._strict: raise Errors.HeaderParseError( 'Unix-from in headers after first rfc822 header') else: # ignore the wierdly placed From_ line # XXX: maybe set unixfrom anyway? or only if not already? continue # Header continuation line if line[0] in ' \t': if not lastheader: raise Errors.HeaderParseError( 'Continuation line seen before first header') lastvalue.append(line) continue # Normal, non-continuation header. BAW: this should check to make # sure it's a legal header, e.g. doesn't contain spaces. Also, we # should expose the header matching algorithm in the API, and # allow for a non-strict parsing mode (that ignores the line # instead of raising the exception). i = line.find(':') if i < 0: if self._strict: raise Errors.HeaderParseError( "Not a header, not a continuation: ``%s''"%line) elif lineno == 1 and line.startswith('--'): # allow through duplicate boundary tags. continue else: raise Errors.HeaderParseError( "Not a header, not a continuation: ``%s''"%line) if lastheader: container[lastheader] = NL.join(lastvalue) lastheader = line[:i] lastvalue = [line[i+1:].lstrip()] # Make sure we retain the last header if lastheader: container[lastheader] = NL.join(lastvalue) | 29cf8f613a5699943f15196d8af7711688c174ea /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/29cf8f613a5699943f15196d8af7711688c174ea/Parser.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
389,
2670,
2485,
12,
2890,
16,
1478,
16,
4253,
4672,
468,
2884,
326,
1607,
16,
5785,
279,
666,
434,
1446,
19,
1132,
5574,
18,
225,
599,
487,
468,
326,
1446,
4696,
326,
9480,
17,
1265,
... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
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,
2670,
2485,
12,
2890,
16,
1478,
16,
4253,
4672,
468,
2884,
326,
1607,
16,
5785,
279,
666,
434,
1446,
19,
1132,
5574,
18,
225,
599,
487,
468,
326,
1446,
4696,
326,
9480,
17,
1265,
... |
sys.exit(1) | raise NotFoundError | def get_environ(self, name): if self.environ.has_key(name): | be99daf4b6f697762bb053d60594aa73fb866280 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12707/be99daf4b6f697762bb053d60594aa73fb866280/__init__.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
336,
67,
28684,
12,
2890,
16,
508,
4672,
309,
365,
18,
28684,
18,
5332,
67,
856,
12,
529,
4672,
2,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
0,
... | [
1,
1,
1,
1,
1,
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,
336,
67,
28684,
12,
2890,
16,
508,
4672,
309,
365,
18,
28684,
18,
5332,
67,
856,
12,
529,
4672,
2,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-100,
-... |
"""Import stats from text file or other mod.""" def AppendToMenu(self,menu,window,data): Link.AppendToMenu(self,menu,window,data) menuItem = wx.MenuItem(menu,self.id,_('Stats...')) menu.AppendItem(menuItem) menuItem.Enable(len(self.data)==1) def Execute(self,event): message = (_("Import item stats from a text file. This will replace existing stats and is not reversible!")) if not balt.askContinue(self.window,message,'bash.stats.import.continue', _('Import Stats')): return fileName = GPath(self.data[0]) fileInfo = bosh.modInfos[fileName] textName = fileName.root+_('_Stats.csv') textDir = bosh.dirs['patches'] textPath = balt.askOpen(self.window,_('Import stats from:'), textDir, textName, '*Stats.csv') if not textPath: return (textDir,textName) = textPath.headTail ext = textName.cext if ext != '.csv': balt.showError(self.window,_('Source file must be a Stats.csv file.')) return progress = balt.Progress(_("Import Stats")) changed = None try: itemStats = bosh.ItemStats() progress(0.1,_("Reading %s.") % (textName.s,)) if ext == '.csv': itemStats.readFromText(textPath) else: srcInfo = bosh.ModInfo(textDir,textName) itemStats.readFromMod(srcInfo) progress(0.2,_("Applying to %s.") % (fileName.s,)) changed = itemStats.writeToMod(fileInfo) progress(1.0,_("Done.")) finally: progress = progress.Destroy() if not changed: balt.showOk(self.window,_("No relevant stats to import."),_("Import Stats")) else: buff = cStringIO.StringIO() for modName in sorted(changed): buff.write('* %03d %s:\n' % (changed[modName], modName.s)) balt.showLog(self.window,buff.getvalue(),_('Import Stats'),icons=bashBlue) | """Import stats from text file or other mod.""" def AppendToMenu(self,menu,window,data): Link.AppendToMenu(self,menu,window,data) menuItem = wx.MenuItem(menu,self.id,_('Stats...')) menu.AppendItem(menuItem) menuItem.Enable(len(self.data)==1) def Execute(self,event): message = (_("Import item stats from a text file. This will replace existing stats and is not reversible!")) if not balt.askContinue(self.window,message,'bash.stats.import.continue', _('Import Stats')): return fileName = GPath(self.data[0]) fileInfo = bosh.modInfos[fileName] textName = fileName.root+_('_Stats.csv') textDir = bosh.dirs['patches'] textPath = balt.askOpen(self.window,_('Import stats from:'), textDir, textName, '*Stats.csv') if not textPath: return (textDir,textName) = textPath.headTail ext = textName.cext if ext != '.csv': balt.showError(self.window,_('Source file must be a Stats.csv file.')) return progress = balt.Progress(_("Import Stats")) changed = None try: itemStats = bosh.ItemStats() progress(0.1,_("Reading %s.") % (textName.s,)) if ext == '.csv': itemStats.readFromText(textPath) else: srcInfo = bosh.ModInfo(textDir,textName) itemStats.readFromMod(srcInfo) progress(0.2,_("Applying to %s.") % (fileName.s,)) changed = itemStats.writeToMod(fileInfo) progress(1.0,_("Done.")) finally: progress = progress.Destroy() if not changed: balt.showOk(self.window,_("No relevant stats to import."),_("Import Stats")) else: buff = cStringIO.StringIO() for modName in sorted(changed): buff.write('* %03d %s:\n' % (changed[modName], modName.s)) balt.showLog(self.window,buff.getvalue(),_('Import Stats'),icons=bashBlue) | def Execute(self,event): fileName = GPath(self.data[0]) fileInfo = bosh.modInfos[fileName] textName = fileName.root+_('_Stats.csv') textDir = bosh.dirs['patches'] textDir.makedirs() #--File dialog textPath = balt.askSave(self.window,_('Export stats to:'), textDir, textName, '*Stats.csv') if not textPath: return (textDir,textName) = textPath.headTail #--Export progress = balt.Progress(_("Export Stats")) try: itemStats = bosh.ItemStats() readProgress = SubProgress(progress,0.1,0.8) readProgress.setFull(len(self.data)) for index,fileName in enumerate(map(GPath,self.data)): fileInfo = bosh.modInfos[fileName] readProgress(index,_("Reading %s.") % (fileName.s,)) itemStats.readFromMod(fileInfo) progress(0.8,_("Exporting to %s.") % (textName.s,)) itemStats.writeToText(textPath) progress(1.0,_("Done.")) finally: progress = progress.Destroy() | 3ac43907fa076fea1e8d682219e2b28fc7419f7b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6682/3ac43907fa076fea1e8d682219e2b28fc7419f7b/basher.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
12,
2890,
16,
2575,
4672,
3968,
273,
611,
743,
12,
2890,
18,
892,
63,
20,
5717,
12538,
273,
324,
17636,
18,
1711,
7655,
63,
17812,
65,
977,
461,
273,
3968,
18,
3085,
15,
67,
26... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
7903,
12,
2890,
16,
2575,
4672,
3968,
273,
611,
743,
12,
2890,
18,
892,
63,
20,
5717,
12538,
273,
324,
17636,
18,
1711,
7655,
63,
17812,
65,
977,
461,
273,
3968,
18,
3085,
15,
67,
26... |
% os.getcwd()) | % _ShellSafe(os.getcwd())) | def compileCmd(self): return (self.distcc() + _gcc + " -c -o testtmp.o %s/testtmp.c" % os.getcwd()) | fdaf4c739372bb2a573823fa0779dc82dc60ac67 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7392/fdaf4c739372bb2a573823fa0779dc82dc60ac67/testdistcc.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
5931,
12,
2890,
4672,
327,
261,
2890,
18,
4413,
952,
1435,
397,
389,
75,
952,
397,
315,
300,
71,
300,
83,
1842,
5645,
18,
83,
738,
87,
19,
3813,
5645,
18,
71,
6,
738,
389,
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,
0,
0,
0,
0,
0,
0,
0,
0... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
4074,
5931,
12,
2890,
4672,
327,
261,
2890,
18,
4413,
952,
1435,
397,
389,
75,
952,
397,
315,
300,
71,
300,
83,
1842,
5645,
18,
83,
738,
87,
19,
3813,
5645,
18,
71,
6,
738,
389,
13... |
def import_core_spambayes_stuff(ini_filename): | def import_core_spambayes_stuff(ini_filenames): global bayes_classifier, bayes_tokenize, bayes_storage | def import_core_spambayes_stuff(ini_filename): if "spambayes.Options" in sys.modules: # Manager probably being re-initialized (via the Outlook 'addin' GUI # Check that nothing has changed underneath us. if __debug__: import spambayes.Options assert spambayes.Options.optionsPathname == \ ini_filename.encode(filesystem_encoding), \ "'spambayes.Options' was imported too early, with the " \ "incorrect directory %r" \ % (spambayes.Options.optionsPathname,) return global bayes_classifier, bayes_tokenize, bayes_storage # ini_filename is Unicode, but environ not unicode aware os.environ["BAYESCUSTOMIZE"] = ini_filename.encode(filesystem_encoding) from spambayes import classifier from spambayes.tokenizer import tokenize from spambayes import storage bayes_classifier = classifier bayes_tokenize = tokenize bayes_storage = storage assert "spambayes.Options" in sys.modules, \ "Expected 'spambayes.Options' to be loaded here" | b46667ea73807a81e6551291dc6102a756e0b7bd /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6126/b46667ea73807a81e6551291dc6102a756e0b7bd/manager.py | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
3644,
67,
1752,
2536,
528,
281,
67,
334,
3809,
12,
8767,
67,
19875,
4672,
2552,
324,
528,
281,
67,
1106,
1251,
16,
324,
528,
281,
67,
2316,
554,
16,
324,
528,
281,
67,
5697... | [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1... | [
1,
8585,
326,
22398,
316,
326,
981,
30,
1652,
1930,
67,
3644,
67,
1752,
2536,
528,
281,
67,
334,
3809,
12,
8767,
67,
19875,
4672,
2552,
324,
528,
281,
67,
1106,
1251,
16,
324,
528,
281,
67,
2316,
554,
16,
324,
528,
281,
67,
5697... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.