rem stringlengths 1 322k | add stringlengths 0 2.05M | context stringlengths 4 228k | meta stringlengths 156 215 |
|---|---|---|---|
return manuel.testing.TestSuite(m, *tests, globs={'path_to_test': os.path.join(here, 'bugs.txt')}) | return manuel.testing.TestSuite(m, *tests, **dict( globs={'path_to_test': os.path.join(here, 'bugs.txt')})) | def test_suite(): optionflags = doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS checker = renormalizing.RENormalizing([ (re.compile(r'<zope\.testing\.doctest\.'), '<doctest.'), ]) tests = ['../index.txt', 'table-example.txt', 'README.txt', 'bugs.txt', 'capture.txt'] m = manuel.ignore.Manuel() m += manuel.doctest.Manu... | 42b07890390e5ad1e2fd10b9e603dc5974714365 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9784/42b07890390e5ad1e2fd10b9e603dc5974714365/tests.py |
self.stc.encoding = detectEncoding(self.utf8) | text = self.utf8 self.stc.encoding, self.stc.refstc.bom = detectEncoding(text) | def testUTF8(self): self.stc.encoding = detectEncoding(self.utf8) print self.stc.encoding self.stc.decodeText(self.utf8) self.stc.prepareEncoding() assert self.utf8 == self.stc.refstc.encoded | 8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb/test_unicode.py |
self.stc.decodeText(self.utf8) | self.stc.decodeText(text) | def testUTF8(self): self.stc.encoding = detectEncoding(self.utf8) print self.stc.encoding self.stc.decodeText(self.utf8) self.stc.prepareEncoding() assert self.utf8 == self.stc.refstc.encoded | 8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb/test_unicode.py |
assert self.utf8 == self.stc.refstc.encoded | assert text == self.stc.refstc.encoded def testUTF8BOM(self): text = self.utf8_bom self.stc.encoding, self.stc.refstc.bom = detectEncoding(text) print self.stc.encoding self.stc.decodeText(text) self.stc.prepareEncoding() assert text == self.stc.refstc.encoded | def testUTF8(self): self.stc.encoding = detectEncoding(self.utf8) print self.stc.encoding self.stc.decodeText(self.utf8) self.stc.prepareEncoding() assert self.utf8 == self.stc.refstc.encoded | 8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb/test_unicode.py |
self.stc.refstc.encoding = detectEncoding(self.utf8) | self.stc.refstc.encoding, self.stc.refstc.bom = detectEncoding(self.utf8) | def testChangeLatin(self): self.stc.refstc.encoding = detectEncoding(self.utf8) print self.stc.refstc.encoding self.stc.decodeText(self.utf8) unicode1 = self.stc.GetLine(1) print repr(unicode1) start = self.stc.FindText(0, self.stc.GetLength(), 'UTF-8') self.stc.SetTargetStart(start) self.stc.SetTargetEnd(start+5) self... | 8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb/test_unicode.py |
self.stc.refstc.encoding = detectEncoding(self.latin1) | self.stc.refstc.encoding, self.stc.refstc.bom = detectEncoding(self.latin1) | def testLatin1(self): self.stc.refstc.encoding = detectEncoding(self.latin1) print repr(self.latin1) utf8 = unicode(self.latin1, "iso-8859-1").encode('utf-8') print repr(utf8) print repr(utf8.decode('utf-8')) print repr(self.latin1.decode('latin-1')) self.stc.decodeText(self.latin1) print repr(self.stc.GetText()) print... | 8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/8c2fdf4ae6ccd2cd0d7c40694df117e33c96e8bb/test_unicode.py |
self.mode.buffer.stc.setRemappedAccelerator(self.action, accelerator_text, self.append) wx.CallAfter(self.mode.resetList) | if accelerator_text: self.mode.buffer.stc.setRemappedAccelerator(self.action, accelerator_text, self.append) wx.CallAfter(self.mode.resetList) else: self.mode.setStatusText("No keystrokes recorded, so no key binding created.") | def finishRecordingHook(self, accelerator_text): self.mode.buffer.stc.setRemappedAccelerator(self.action, accelerator_text, self.append) wx.CallAfter(self.mode.resetList) | 07c18d0928df36e3a196f21f31e46acb868fee85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/07c18d0928df36e3a196f21f31e46acb868fee85/keyboard.py |
def startupFailureCallback(self, p): dprint("Couldn't run %s" % p.cmd) | def startupFailureCallback(self, job, text): dprint("Couldn't run '%s':\n error: %s" % (job.cmd, text)) | def startupFailureCallback(self, p): dprint("Couldn't run %s" % p.cmd) | a93e25bf540182b88282813a53eb40a70e1d8e9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/a93e25bf540182b88282813a53eb40a70e1d8e9a/processmanager.py |
def startupFailureCallback(self, p): | def startupFailureCallback(self, p, text): | def startupFailureCallback(self, p): self.callback(self) | a93e25bf540182b88282813a53eb40a70e1d8e9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/a93e25bf540182b88282813a53eb40a70e1d8e9a/processmanager.py |
wx.CallAfter(self._job.jobout.startupFailureCallback, msg) | wx.CallAfter(self._job.jobout.startupFailureCallback, self._job, err) | def run(self): """Run the process until finished or aborted. Don't call this directly instead call self.start() to start the thread else this will run in the context of the current thread. @note: overridden from Thread | a93e25bf540182b88282813a53eb40a70e1d8e9a /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/a93e25bf540182b88282813a53eb40a70e1d8e9a/processmanager.py |
try: key = str(url) if key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword][ukey] = cls.layout[major_mode_keyword][key] del cls.layout[major_mode_keyword][key] except UnicodeEncodeError: pass | if major_mode_keyword in cls.layout: try: key = str(url) if key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword][ukey] = cls.layout[major_mode_keyword][key] del cls.layout[major_mode_keyword][key] except UnicodeEncodeError: pass | def getLayoutSubsequent(cls, major_mode_keyword, url): #dprint("getLayoutSubsequent") ukey = unicode(url) try: key = str(url) # Convert old style string keyword to unicode keyword if key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword][ukey] = cls.layout[major_mode_keyword][key] del cls.layout[major_mo... | 4e3454e9beed6a2bf2dacb218db783bfe75b09e0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/4e3454e9beed6a2bf2dacb218db783bfe75b09e0/major.py |
self.mode.buffer.revert(text) | self.mode.buffer.revert(encoding=text) | def processMinibuffer(self, minibuffer, mode, text): #dprint("Revert to encoding %s" % text) # see if it's a known encoding try: 'test'.encode(text) # if we get here, it's valid self.mode.buffer.revert(text) if text != self.mode.buffer.stc.encoding: self.mode.setStatusText("Failed converting to %s; loaded as binary (pr... | cf56d234d99c79a038cfc2338a94d9a6f7416785 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/cf56d234d99c79a038cfc2338a94d9a6f7416785/fundamental_menu.py |
print("sending %s to %s" % (result, callback)) | def _do_callback(self, result, callback): # Ignore encoding errors and return an empty line instead try: result = result.decode(sys.getfilesystemencoding()) except UnicodeDecodeError: result = os.linesep | c60aa083174dfdb1f06aea69cb79d1ce7cca0a3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/c60aa083174dfdb1f06aea69cb79d1ce7cca0a3c/processmanager.py | |
print("Windows command: %s" % command) | def run(self): """Run the process until finished or aborted. Don't call this directly instead call self.start() to start the thread else this will run in the context of the current thread. @note: overridden from Thread | c60aa083174dfdb1f06aea69cb79d1ce7cca0a3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/c60aa083174dfdb1f06aea69cb79d1ce7cca0a3c/processmanager.py | |
print("Unix command: %s" % command) | def run(self): """Run the process until finished or aborted. Don't call this directly instead call self.start() to start the thread else this will run in the context of the current thread. @note: overridden from Thread | c60aa083174dfdb1f06aea69cb79d1ce7cca0a3c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/c60aa083174dfdb1f06aea69cb79d1ce7cca0a3c/processmanager.py | |
return cls.layout[major_mode_keyword][str(url)] | key = str(url) if key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword][ukey] = cls.layout[major_mode_keyword][key] del cls.layout[major_mode_keyword][key] except UnicodeEncodeError: pass try: return cls.layout[major_mode_keyword][ukey] | def getLayoutSubsequent(cls, major_mode_keyword, url): #dprint("getLayoutSubsequent") try: #dprint(cls.layout[major_mode_keyword]) return cls.layout[major_mode_keyword][str(url)] except KeyError: return {} | 367f9cf2f514f21a0bf61a0eae519b4412dfed9b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/367f9cf2f514f21a0bf61a0eae519b4412dfed9b/major.py |
cls.layout[major_mode_keyword][str(url)] = perspective | cls.layout[major_mode_keyword][unicode(url)] = perspective | def updateLayoutSubsequent(cls, major_mode_keyword, url, perspective): #dprint("updateLayoutSubsequent") if major_mode_keyword not in cls.layout: cls.layout[major_mode_keyword] = {} cls.layout[major_mode_keyword][str(url)] = perspective | 367f9cf2f514f21a0bf61a0eae519b4412dfed9b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/367f9cf2f514f21a0bf61a0eae519b4412dfed9b/major.py |
def reportSuccess(self, text, data): | def reportSuccess(self, text, data=None): | def reportSuccess(self, text, data): import wx wx.CallAfter(self.reportSuccessGUI, text, data) | 3534a980eb6b3a29e56a53f542a693e3dbe75262 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/3534a980eb6b3a29e56a53f542a693e3dbe75262/threadutils.py |
if self._stdin is not None: stdin = subprocess.PIPE else: stdin = None | def run(self): """Run the process until finished or aborted. Don't call this directly instead call self.start() to start the thread else this will run in the context of the current thread. @note: overridden from Thread | b2a84c23c7e4f21c38f933384feb433f1442f031 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/b2a84c23c7e4f21c38f933384feb433f1442f031/processmanager.py | |
stdin=stdin, | stdin=subprocess.PIPE, | def run(self): """Run the process until finished or aborted. Don't call this directly instead call self.start() to start the thread else this will run in the context of the current thread. @note: overridden from Thread | b2a84c23c7e4f21c38f933384feb433f1442f031 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/b2a84c23c7e4f21c38f933384feb433f1442f031/processmanager.py |
self._proc.stdin.close() | self._proc.stdin.close() | def run(self): """Run the process until finished or aborted. Don't call this directly instead call self.start() to start the thread else this will run in the context of the current thread. @note: overridden from Thread | b2a84c23c7e4f21c38f933384feb433f1442f031 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/b2a84c23c7e4f21c38f933384feb433f1442f031/processmanager.py |
how_likely = mode.verifyLanguage(header) cls.dprint("%s: %d" % (mode, how_likely)) if how_likely > 0: likely.append((how_likely, mode)) | try: how_likely = mode.verifyLanguage(header) cls.dprint("%s: %d" % (mode, how_likely)) if how_likely > 0: likely.append((how_likely, mode)) except UnicodeDecodeError: eprint("Encoding error: file likely not marked with the correct encoding. File type may be incorrectly idendified.") | def scanLanguage(cls, header, modes): """Scan for a pattern match in the first bytes of the file. Determine if there is a 'magic' pattern in the first n bytes of the file that can associate it with a major mode. | 1fd5aa025ae2019565106b9f2416cc7b0e8f1529 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/1fd5aa025ae2019565106b9f2416cc7b0e8f1529/majormodematcher.py |
self.heatmap = HSI.createCube('bsq', self.lines, self.samples, 1, self.dtype) data = self.heatmap.getBandRaw(0) | self.euclidean = HSI.createCube('bsq', self.lines, self.samples, 1, self.dtype) data = self.euclidean.getBandRaw(0) | def getEuclideanDistanceByBand(self,nbins=500): """Calculate the euclidean distance for every pixel in two cubes using bands Fast for BSQ cubes, slow for BIL, and extremely slow for BIP. """ self.heatmap = HSI.createCube('bsq', self.lines, self.samples, 1, self.dtype) data = self.heatmap.getBandRaw(0) working = numpy... | e6b4f8b8fef2188b2a8b908daaf998eee930bb85 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/e6b4f8b8fef2188b2a8b908daaf998eee930bb85/utils.py |
ctrl = CommaSeparatedListCtrl(frame, -1, initialValue=", ".join([str(i) for i in range(300)])) | ctrl = CSVCtrl(frame, -1, initialValue=", ".join([str(i) for i in range(300)])) | def SetLabel(self, value): """ Set the label's current text """ rvalue = self.label.SetLabel(value) self.Refresh(True) return rvalue | 20e3201ffa557da042c1f94b215cdedb83a88558 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/20e3201ffa557da042c1f94b215cdedb83a88558/csv_ctrl.py |
wx.PopupWindow.__init__(self, frame, style) | PopupClass.__init__(self, frame, style) | def __init__(self, frame, delay=5000, style=wx.BORDER_SIMPLE): """Creates (but doesn't show) the PopupStatusBar @param frame: the parent frame @kwarg delay: (optional) delay in milliseconds before each message decays """ wx.PopupWindow.__init__(self, frame, style) self.SetBackgroundColour("#B6C1FF") self.stack = wx.... | 9d2a3edb8d79491148a780366f8fc90ef549bb6b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/9d2a3edb8d79491148a780366f8fc90ef549bb6b/popupstatusbar.py |
def OnTimer(self, evt): if not self.display_times: # It is possible the timer could go off after the call to clear(), # so if the list is empty, return without restarting the timer return current = time.time() * 1000 #print("Timer at %f" % current) remove = True if (self.last_is_status and len(self.display_times) == 1)... | 9d2a3edb8d79491148a780366f8fc90ef549bb6b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/9d2a3edb8d79491148a780366f8fc90ef549bb6b/popupstatusbar.py | ||
if remaining < 0: | if remaining < 1: | def OnTimer(self, evt): if not self.display_times: # It is possible the timer could go off after the call to clear(), # so if the list is empty, return without restarting the timer return current = time.time() * 1000 #print("Timer at %f" % current) remove = True if (self.last_is_status and len(self.display_times) == 1)... | 9d2a3edb8d79491148a780366f8fc90ef549bb6b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/9d2a3edb8d79491148a780366f8fc90ef549bb6b/popupstatusbar.py |
while end < length and utext[end].isalpha(): | while end < length and (utext[end].isalpha() or utext[end] == "'"): | def findNextWord(self, utext, index, length): """Find the next valid word to check. Designed to be overridden in subclasses, this method takes a starting position in an array of text and returns a tuple indicating the next valid word in the string. @param utext: array of unicode chars @param i: starting index within ... | 99d9d9195cb6b12285639df01acc58876d0a6b2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/99d9d9195cb6b12285639df01acc58876d0a6b2d/stcspellcheck.py |
end = self.stc.WordEndPosition(pos, True) start = self.stc.WordStartPosition(pos, True) | end = self.getLikelyWordEnd(pos) start = self.getLikelyWordStart(pos) | def checkWord(self, pos=None, atend=False): """Check the word at the current or specified position. @param pos: position of a character in the word (or at the start or end of the word), or None to use the current position @param atend: True if you know the cursor is at the end of the word """ if pos is None: pos = sel... | 99d9d9195cb6b12285639df01acc58876d0a6b2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/99d9d9195cb6b12285639df01acc58876d0a6b2d/stcspellcheck.py |
word_start = self.stc.WordStartPosition(cursor, True) word_end = self.stc.WordEndPosition(cursor, True) | word_start = self.getLikelyWordStart(cursor) word_end = self.getLikelyWordEnd(cursor) if self._spelling_debug: print("cursor in middle of word, removing styling %d-%d" % (word_start, word_end)) | def processDirtyRanges(self): cursor = self.stc.GetCurrentPos() # Check that the cursor has moved off the current word and if so check # its spelling if self.current_word_start > 0: if cursor < self.current_word_start or cursor > self.current_word_end: self.checkRange(self.current_word_start, self.current_word_end) se... | 99d9d9195cb6b12285639df01acc58876d0a6b2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/99d9d9195cb6b12285639df01acc58876d0a6b2d/stcspellcheck.py |
range_start = self.stc.WordStartPosition(start, True) range_end = self.stc.WordEndPosition(end, True) | range_start = self.getLikelyWordStart(start) range_end = self.getLikelyWordEnd(end) | def processDirtyRange(self, start, end): range_start = self.stc.WordStartPosition(start, True) range_end = self.stc.WordEndPosition(end, True) if self._spelling_debug: print("processing dirty range %d-%d (modified from %d-%d): %s" % (range_start, range_end, start, end, repr(self.stc.GetTextRange(range_start, range_end)... | 99d9d9195cb6b12285639df01acc58876d0a6b2d /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/99d9d9195cb6b12285639df01acc58876d0a6b2d/stcspellcheck.py |
fh = open(url, "rb") return matcher.iterMatches(url, fh) | try: fh = open(url, "rb") return matcher.iterMatches(url, fh) except: dprint("Failed opening %s" % url) return iter([]) | def getMatchGenerator(self, url, matcher): if isinstance(url, vfs.Reference): if url.scheme != "file": dprint("vfs not threadsafe; skipping %s" % unicode(url).encode("utf-8")) return url = unicode(url.path).encode("utf-8") fh = open(url, "rb") return matcher.iterMatches(url, fh) | 8a53ddc819dd15ee64c807b32a1cf51bc80f8754 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/8a53ddc819dd15ee64c807b32a1cf51bc80f8754/searchutils.py |
default_menu = (("File/Print Options", 995.6), 100) | default_menu = (("File/Print Options", 995.5), 200) | def action(self, index=-1, multiplier=1): self.mode.classprefs.print_style = index | 321ca99d283105a3d588f9c067273d5c3360f8d4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/321ca99d283105a3d588f9c067273d5c3360f8d4/text.py |
if value == d[keyword]: | if keyword in d and value == d[keyword]: | def convertSection(cls, section): | 912b3c0549a44850b5d18f984e16c0259760d52e /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/912b3c0549a44850b5d18f984e16c0259760d52e/userparams.py |
return stc.GetIndentString(7) | return stc.GetIndentString(6) | def getNewLineIndentString(self, stc, col, ind): """Return the number of characters to be indented on a new line @param stc: stc of interest @param col: column position of cursor on line @param ind: indentation in characters of cursor on line """ return stc.GetIndentString(7) | 01e376734c4ebcf752b313d87d3255a417b01ac5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/01e376734c4ebcf752b313d87d3255a417b01ac5/fortran_77.py |
connection_cache = TimeExpiringDict(10) | connection_cache = {} | def get_transport(transport_key): t = paramiko.Transport(transport_key) t.start_client() if not t.is_active(): raise OSError("Failure to connect to: '%s'" % str(transport_key)) pub_key = t.get_remote_server_key() return t | 4d9958325e95abe3f6b98541473e740c9aefa612 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/4d9958325e95abe3f6b98541473e740c9aefa612/sftp.py |
else: | transport = client.get_channel().get_transport() if not transport.is_active(): dprint("Cached channel closed. Opening new connection for %s" % ref) client = None if client is None: | def _get_client(cls, ref): newref = cls._copy_root_reference_without_username(ref) if newref in cls.connection_cache: client = cls.connection_cache[newref] if cls.debug: dprint("Found cached sftp connection: %s" % client) else: client = cls._get_sftp(ref) if cls.debug: dprint("Creating sftp connection: %s" % client) cl... | 4d9958325e95abe3f6b98541473e740c9aefa612 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/4d9958325e95abe3f6b98541473e740c9aefa612/sftp.py |
cls.dprint("%s: layout=%s" % (url, layout)) | cls.dprint("%s: layout=%s" % (unicode(url), unicode(layout))) | def getLayoutSubsequent(cls, major_mode_keyword, url): #dprint("getLayoutSubsequent") ukey = unicode(url).encode("utf-8") if major_mode_keyword in cls.layout: try: key = str(url) # Convert old style string keyword to unicode keyword if ukey != key and key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword... | 9bdec4c0b5dc03b247a33ca307b905d71f07cb38 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/9bdec4c0b5dc03b247a33ca307b905d71f07cb38/major.py |
if action.keyboard is None: keyboard = "" else: keyboard = str(action.keyboard) | keyboard = action.keyboard if keyboard is None: keyboard = "" else: keyboard = str(keyboard) | def __cmp__(self, other): return cmp(self.name, other.name) | 1b2d02320f7a2a1c281ed7c48ad12c342d7df7d3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/1b2d02320f7a2a1c281ed7c48ad12c342d7df7d3/keyboard.py |
self.pid = wx.Execute(self.cmd, wx.EXEC_ASYNC, self.process) | if wx.Platform != '__WXMSW__': flag = wx.EXEC_ASYNC else: flag = wx.EXEC_NOHIDE self.pid = wx.Execute(self.cmd, flag, self.process) | def run(self, text=""): assert self.dprint("Running %s in %s" % (self.cmd, self.working_dir)) savecwd = os.getcwd() try: os.chdir(self.working_dir) self.process = wx.Process(self.handler) self.process.Redirect(); self.pid = wx.Execute(self.cmd, wx.EXEC_ASYNC, self.process) finally: os.chdir(savecwd) if self.pid==0: ass... | 69d51371f7dfef0688edc89a04e1c6055e0d3d33 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/69d51371f7dfef0688edc89a04e1c6055e0d3d33/processmanager.py |
return attrs.st_mtime @classmethod def get_mtime(cls, ref): attrs = cls._stat(ref) return attrs.st_mtime | return datetime.fromtimestamp(attrs.st_mtime) get_ctime = get_mtime | def get_mtime(cls, ref): attrs = cls._stat(ref) return attrs.st_mtime | 82daf178b495d3891617b5e173f5efa210a49c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/82daf178b495d3891617b5e173f5efa210a49c73/sftp.py |
return attrs.st_atime | return datetime.fromtimestamp(attrs.st_atime) | def get_atime(cls, ref): attrs = cls._stat(ref) return attrs.st_atime | 82daf178b495d3891617b5e173f5efa210a49c73 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/82daf178b495d3891617b5e173f5efa210a49c73/sftp.py |
self._spelling_debug = True | self._spelling_debug = False | def __init__(self, stc, *args, **kwargs): """Mixin must be initialized using this constructor. Keyword arguments are also available instead of calling the convenience functions. For L{setIndicator}, use C{indicator}, C{indicator_color}, and {indicator_style}; for L{setLanguage}, use C{language}; and for L{setMinimumW... | 67dfdf80647b0e756f757c29fc2e4d8f127ec543 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/67dfdf80647b0e756f757c29fc2e4d8f127ec543/stcspellcheck.py |
list.InsertSizedColumn(0, "URL", min=100, greedy=False) | list.InsertSizedColumn(0, "File", min=100, greedy=False) | def createColumns(self, list): list.InsertSizedColumn(0, "URL", min=100, greedy=False) list.InsertSizedColumn(1, "Line", min=10, greedy=False) list.InsertSizedColumn(2, "Match", min=300, greedy=True) | ac13a415d46371714bb2a8ae04bcd47af7cfe478 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/ac13a415d46371714bb2a8ae04bcd47af7cfe478/search_in_files.py |
return (unicode(item.url), item.line, unicode(item.text)) | return (unicode(item.short), item.line, unicode(item.text), item.url) | def getItemRawValues(self, index, item): return (unicode(item.url), item.line, unicode(item.text)) | ac13a415d46371714bb2a8ae04bcd47af7cfe478 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/ac13a415d46371714bb2a8ae04bcd47af7cfe478/search_in_files.py |
self.frame.open(values[0], options={'line':values[1] - 1}) | self.frame.open(values[3], options={'line':values[1] - 1}) | def OnItemActivated(self, evt): index = evt.GetIndex() orig_index = self.list.GetItemData(index) values = self.list.itemDataMap[orig_index] dprint(values) self.frame.open(values[0], options={'line':values[1] - 1}) | ac13a415d46371714bb2a8ae04bcd47af7cfe478 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/ac13a415d46371714bb2a8ae04bcd47af7cfe478/search_in_files.py |
dprint("no selection; cursor at %s" % start) | self.dprint("no selection; cursor at %s" % start) | def action(self, index=-1, multiplier=1): s = self.mode # FIXME: Because the autoindenter depends on the styling information, # need to make sure the document is up to date. But, is this call to # style the entire document fast enough in practice, or will it have # to be optimized? s.Colourise(0, s.GetTextLength()) | ab601bed8fd584bac518307f6c201084880837c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/ab601bed8fd584bac518307f6c201084880837c1/electric_actions.py |
dprint("selection: %s - %s" % (start, end)) | self.dprint("selection: %s - %s" % (start, end)) | def action(self, index=-1, multiplier=1): s = self.mode # FIXME: Because the autoindenter depends on the styling information, # need to make sure the document is up to date. But, is this call to # style the entire document fast enough in practice, or will it have # to be optimized? s.Colourise(0, s.GetTextLength()) | ab601bed8fd584bac518307f6c201084880837c1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/ab601bed8fd584bac518307f6c201084880837c1/electric_actions.py |
except re.error: | self.error = "" except re.error, errmsg: | def __init__(self, string, match_case): try: if not match_case: flags = re.IGNORECASE else: flags = 0 self.cre = re.compile(string, flags) except re.error: self.cre = None self.last_match = None | f5abb7a4f84c8793efcf5ba079856510ba0a3fad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/f5abb7a4f84c8793efcf5ba079856510ba0a3fad/search_in_files.py |
return bool(self.cre) | return bool(self.string) and bool(self.cre) def getErrorString(self): if len(self.string) == 0: return "Search error: search string is blank" return "Regular expression error: %s" % self.error | def isValid(self): return bool(self.cre) | f5abb7a4f84c8793efcf5ba079856510ba0a3fad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/f5abb7a4f84c8793efcf5ba079856510ba0a3fad/search_in_files.py |
self.setStatusText("Invalid search string.") | if hasattr(matcher, "getErrorString"): error = matcher.getErrorString() else: error = "Invalid search string." self.setStatusText(error) self.showSearchButton(False) | def OnStartSearch(self, evt): if not self.isSearchRunning(): self.showSearchButton(True) method = self.buffer.stc.search_method.option if method.isValid(): status = SearchStatus(self) matcher = self.buffer.stc.search_type.option.getStringMatcher(self.search_text.GetValue()) ignorer = WildcardListIgnorer(self.ignore_fil... | f5abb7a4f84c8793efcf5ba079856510ba0a3fad /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/f5abb7a4f84c8793efcf5ba079856510ba0a3fad/search_in_files.py |
if not prefix.endswith("/"): prefix += "/" | if not prefix.endswith(os.sep): prefix += os.sep | def getPrefix(self): prefix = unicode(self.pathname) if not prefix.endswith("/"): prefix += "/" return prefix | 2ba915f445ce6aec1f87d73643182fcbd8094d54 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/2ba915f445ce6aec1f87d73643182fcbd8094d54/search_in_files.py |
self.wrapper.spring.clearRadio() self.frame.spring.clearRadio() | try: self.wrapper.spring.clearRadio() self.frame.spring.clearRadio() except wx.PyDeadObjectError: pass | def OnFocus(self, evt): """Callback used to pop down any springtabs. When the major mode loses keyboard focus, the springtabs should be cleared to allow the new focus receiver to display itself. This fails when the major mode never takes keyboard focus at all, in which case a focus-lost event is never generated and t... | df08ace7e45208aa8ac1fa9502266e36d825166f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/df08ace7e45208aa8ac1fa9502266e36d825166f/major.py |
options = {'byte_order': self.endian} | options['byte_order'] = self.endian | def action(self, index=-1, multiplier=1): filename = self.frame.showSaveAs("Save Image as ENVI", wildcard="BIL (*.bil)|*.bil|BIP (*.bip)|*.bip|BSQ (*.bsq)|*.bsq") if filename: root, ext = os.path.splitext(filename) ext = ext.lower() if ext in ['.bil', '.bip', '.bsq']: handler = HyperspectralFileFormat.getHandlerByName(... | 243a1ac4bef98113e28a4c52f0495304da0962bd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/243a1ac4bef98113e28a4c52f0495304da0962bd/hsi_menu.py |
list.InsertSizedColumn(0, "File", min=100, greedy=False) | list.InsertSizedColumn(0, "File", min=100, max=250, greedy=False) | def createColumns(self, list): list.InsertSizedColumn(0, "File", min=100, greedy=False) list.InsertSizedColumn(1, "Line", min=10, greedy=False) list.InsertSizedColumn(2, "Match", min=300, greedy=True) | 522cdb56e377181d11d37e0775d5cff9a5347da2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/522cdb56e377181d11d37e0775d5cff9a5347da2/search_in_files.py |
list.InsertSizedColumn(2, "Match", min=300, greedy=True) | list.InsertSizedColumn(2, "Match", min=300, greedy=True, ok_offscreen=True) | def createColumns(self, list): list.InsertSizedColumn(0, "File", min=100, greedy=False) list.InsertSizedColumn(1, "Line", min=10, greedy=False) list.InsertSizedColumn(2, "Match", min=300, greedy=True) | 522cdb56e377181d11d37e0775d5cff9a5347da2 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/522cdb56e377181d11d37e0775d5cff9a5347da2/search_in_files.py |
self.raw.tofile(str(url.path)) | filename = unicode(url.path) try: self.raw.tofile(filename) except ValueError: fd = open(filename, "wb") flat = self.raw.ravel() size = flat.size start = 0 while start < size: last = start + 10000 if last > size: last = size fd.write(flat[start:last].tostring()) start = last | def save(self, url): if self.mmap: self.mmap.flush() self.mmap.sync() else: self.raw.tofile(str(url.path)) | 9e795e7f858ef9646a014fc9761d64b26c050635 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/9e795e7f858ef9646a014fc9761d64b26c050635/cube.py |
ukey = unicode(url) | ukey = unicode(url).encode("utf-8") | def getLayoutSubsequent(cls, major_mode_keyword, url): #dprint("getLayoutSubsequent") ukey = unicode(url) if major_mode_keyword in cls.layout: try: key = str(url) # Convert old style string keyword to unicode keyword if key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword][ukey] = cls.layout[major_mode_... | 82cadc0259af62e12f609221a12afb4db898cba4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/82cadc0259af62e12f609221a12afb4db898cba4/major.py |
if key in cls.layout[major_mode_keyword]: | if ukey != key and key in cls.layout[major_mode_keyword]: | def getLayoutSubsequent(cls, major_mode_keyword, url): #dprint("getLayoutSubsequent") ukey = unicode(url) if major_mode_keyword in cls.layout: try: key = str(url) # Convert old style string keyword to unicode keyword if key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword][ukey] = cls.layout[major_mode_... | 82cadc0259af62e12f609221a12afb4db898cba4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/82cadc0259af62e12f609221a12afb4db898cba4/major.py |
return cls.layout[major_mode_keyword][ukey] | layout = cls.layout[major_mode_keyword][ukey] | def getLayoutSubsequent(cls, major_mode_keyword, url): #dprint("getLayoutSubsequent") ukey = unicode(url) if major_mode_keyword in cls.layout: try: key = str(url) # Convert old style string keyword to unicode keyword if key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword][ukey] = cls.layout[major_mode_... | 82cadc0259af62e12f609221a12afb4db898cba4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/82cadc0259af62e12f609221a12afb4db898cba4/major.py |
return {} | layout = {} cls.dprint("%s: layout=%s" % (url, layout)) return layout | def getLayoutSubsequent(cls, major_mode_keyword, url): #dprint("getLayoutSubsequent") ukey = unicode(url) if major_mode_keyword in cls.layout: try: key = str(url) # Convert old style string keyword to unicode keyword if key in cls.layout[major_mode_keyword]: cls.layout[major_mode_keyword][ukey] = cls.layout[major_mode_... | 82cadc0259af62e12f609221a12afb4db898cba4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/82cadc0259af62e12f609221a12afb4db898cba4/major.py |
if self.frame == frame: | if not self.frame: dprint("Frame has been deleted!!! Message was:") dprint(message) dlg = wx.MessageDialog(wx.GetApp().GetTopWindow(), message, "Error message for deleted frame!!!", wx.OK | wx.ICON_EXCLAMATION ) retval=dlg.ShowModal() dlg.Destroy() elif self.frame == frame: | def showError(self, message=None): data = message.data if isinstance(data, tuple) or isinstance(data, list): frame = data[0] text = data[1] else: frame = wx.GetApp().GetTopWindow() text = data if self.frame == frame: paneinfo = frame._mgr.GetPane(self) if self.classprefs.unhide_on_message: if not paneinfo.IsShown(): pa... | 057547cad5f4be297121616fac08b79566b49256 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/057547cad5f4be297121616fac08b79566b49256/error_log.py |
StrParam('minor_modes', 'GraphvizView'), ) class GraphvizViewMinorMode(MinorMode, JobOutputMixin, wx.Panel, debugmixin): """Display the graphical view of the DOT file. This displays the graphic image that is represented by the .dot file. It calls the external graphviz program and displays a bitmap version of the g... | StrParam('graphic_format', 'png'), StrParam('layout', 'dot'), SupersededParam('output_log') | def action(self, index=-1, multiplier=1): self.frame.open("about:sample.dot") | 21834e12e052ab98f36c3cfa4905e6f6dd89dab8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/21834e12e052ab98f36c3cfa4905e6f6dd89dab8/graphviz.py |
dotprogs = ['dot', 'neato', 'twopi', 'circo', 'fdp'] | def getInterpreterArgs(self): self.dot_output = vfs.reference_with_new_extension(self.buffer.url, self.classprefs.graphic_format) args = "%s -v -T%s -K%s -o%s" % (self.classprefs.interpreter_args, self.classprefs.graphic_format, self.classprefs.layout, str(self.dot_output.path)) return args | def action(self, index=-1, multiplier=1): self.frame.open("about:sample.dot") | 21834e12e052ab98f36c3cfa4905e6f6dd89dab8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/21834e12e052ab98f36c3cfa4905e6f6dd89dab8/graphviz.py |
@classmethod def worksWithMajorMode(self, mode): if mode.__class__ == GraphvizMode: return True return False def __init__(self, parent, **kwargs): MinorMode.__init__(self, parent, **kwargs) wx.Panel.__init__(self, parent) self.sizer = wx.BoxSizer(wx.VERTICAL) self.SetSizer(self.sizer) buttons = wx.BoxSizer(wx.HORIZO... | def getJobOutput(self): return self | def action(self, index=-1, multiplier=1): self.frame.open("about:sample.dot") | 21834e12e052ab98f36c3cfa4905e6f6dd89dab8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/21834e12e052ab98f36c3cfa4905e6f6dd89dab8/graphviz.py |
self.busy(True) | def startupCallback(self, job): self.process = job self.busy(True) self.preview = StringIO() | 21834e12e052ab98f36c3cfa4905e6f6dd89dab8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/21834e12e052ab98f36c3cfa4905e6f6dd89dab8/graphviz.py | |
self.process = None self.busy(False) self.createImage() def createImage(self): assert self.dprint("using image, size=%s" % len(self.preview.getvalue())) if len(self.preview.getvalue())==0: self.mode.setStatusText("Error running graphviz!") return fh = StringIO(self.preview.getvalue()) img = wx.EmptyImage() if img... | del self.process self.frame.findTabOrOpen(self.dot_output) | def finishedCallback(self, job): assert self.dprint() self.process = None self.busy(False) self.createImage() # Don't call evt.Skip() here because it causes a crash | 21834e12e052ab98f36c3cfa4905e6f6dd89dab8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/21834e12e052ab98f36c3cfa4905e6f6dd89dab8/graphviz.py |
def getMinorModes(self): yield GraphvizViewMinorMode | def getMajorModes(self): yield GraphvizMode | 21834e12e052ab98f36c3cfa4905e6f6dd89dab8 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11522/21834e12e052ab98f36c3cfa4905e6f6dd89dab8/graphviz.py | |
def download(self, url, path): | def download(url, path): | def download(self, url, path): """ Download url and store it at path """ f = None g = None try: f = urllib.urlopen(url) g = open(path, 'wb') copyobj(f, g) finally: if f: f.close() if g: g.close() | 86603d2facf8767a09b622a032e173fe518ddb13 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/86603d2facf8767a09b622a032e173fe518ddb13/agent.py |
main() | main() | def main(): home = config.get_home() default_cache = os.path.join(home,"var","cache") default_cache = os.getenv("MULE_CACHE", default_cache) parser = OptionParser() parser.add_option("-f", "--foreground", action="store_true", dest="foreground", default=False, help="Do not fork [default: fork]") parser.add_option("-r", ... | 86603d2facf8767a09b622a032e173fe518ddb13 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/86603d2facf8767a09b622a032e173fe518ddb13/agent.py |
sys.stderr.write( "Usage: %s COMMAND\n" % os.path.basename(sys.argv[0])) sys.stderr.write( """ | sys.stderr.write("Usage: %s COMMAND\n" % os.path.basename(sys.argv[0])) sys.stderr.write(""" | def usage(): sys.stderr.write( "Usage: %s COMMAND\n" % os.path.basename(sys.argv[0])) sys.stderr.write( """ | daeb8105f0fedc695bf3dfc5e9ad3c797f1949b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/daeb8105f0fedc695bf3dfc5e9ad3c797f1949b3/client.py |
""" | """) | def usage(): sys.stderr.write( "Usage: %s COMMAND\n" % os.path.basename(sys.argv[0])) sys.stderr.write( """ | daeb8105f0fedc695bf3dfc5e9ad3c797f1949b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/daeb8105f0fedc695bf3dfc5e9ad3c797f1949b3/client.py |
main() | main() | def main(): if len(sys.argv) < 2: usage() cmd = sys.argv[1] args = sys.argv[2:] if cmd in ['get']: parser = OptionParser("Usage: %prog get LFN PATH") parser.add_option("-s", "--symlink", action="store_true", dest="symlink", default=SYMLINK, help="symlink PATH to cached file [default: %default]") (options, args) = par... | daeb8105f0fedc695bf3dfc5e9ad3c797f1949b3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/daeb8105f0fedc695bf3dfc5e9ad3c797f1949b3/client.py |
except DBLockDeadlockError, e: | except bdb.DBLockDeadlockError, e: | def with_transaction(self, *args, **kwargs): deadlocks = 0 while True: txn = self.env.txn_begin() try: result = method(self, txn, *args, **kwargs) txn.commit() return result except DBLockDeadlockError, e: txn.abort() deadlocks += 1 if deadlocks < retries: self.log.info("Deadlock detected, retrying") continue else: self... | 9e07faa89ded53ec47eff4d37dd1872c7441d8ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/9e07faa89ded53ec47eff4d37dd1872c7441d8ff/bdb.py |
def list(self): | def list(self, txn): | def list(self): cur = self.db.cursor(txn) try: result = [] current = cur.first() while current is not None: rec = pickle.loads(current[1]) rec['lfn'] = current[0] result.append(rec) current = cur.next() return result finally: cur.close() | 9e07faa89ded53ec47eff4d37dd1872c7441d8ff /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/9e07faa89ded53ec47eff4d37dd1872c7441d8ff/bdb.py |
def with_transaction(method): | def with_transaction(method, retries=3): | def with_transaction(method): def with_transaction(self, *args, **kwargs): if len(args)>0 and isinstance(args[0],Database): return method(self, *args, **kwargs) else: txn = self.env.txn_begin() try: result = method(self, txn, *args, **kwargs) txn.commit() return result except: txn.abort() raise return with_transaction | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py |
if len(args)>0 and isinstance(args[0],Database): return method(self, *args, **kwargs) else: | deadlocks = 0 while True: | def with_transaction(self, *args, **kwargs): if len(args)>0 and isinstance(args[0],Database): return method(self, *args, **kwargs) else: txn = self.env.txn_begin() try: result = method(self, txn, *args, **kwargs) txn.commit() return result except: txn.abort() raise | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py |
class CheckpointThread(Thread): | class DatabaseManagerThread(Thread): | def with_transaction(self, *args, **kwargs): if len(args)>0 and isinstance(args[0],Database): return method(self, *args, **kwargs) else: txn = self.env.txn_begin() try: result = method(self, txn, *args, **kwargs) txn.commit() return result except: txn.abort() raise | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py |
self.log = log.get_log("ckpt_thread") | self.log = log.get_log("bdb manager") | def __init__(self, env, interval=300): Thread.__init__(self) self.setDaemon(True) self.log = log.get_log("ckpt_thread") self.env = env self.interval = interval | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py |
if bdb.version() > (4,7): | if hasattr(self.env, "log_set_config"): | def __init__(self, path, name, duplicates=False): self.path = path self.dbpath = os.path.join(self.path, name) if not os.path.isdir(self.path): os.makedirs(self.path) self.env = bdb.DBEnv() self.env.set_tx_max(self.max_txns) self.env.set_lk_max_lockers(self.max_txns*2) self.env.set_lk_max_locks(self.max_txns*2) self.... | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py |
def lookup(self, lfn): cur = self.db.cursor() | @with_transaction def lookup(self, txn, lfn): cur = self.db.cursor(txn) | def delete(self, txn, lfn, pfn=None): cur = self.db.cursor(txn) try: if pfn is None: current = cur.set(lfn) while current is not None: cur.delete() current = cur.next_dup() else: current = cur.set_both(lfn, pfn) if current is not None: cur.delete() finally: cur.close() | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py |
def get(self, lfn): current = self.db.get(lfn) | @with_transaction def get(self, txn, lfn): current = self.db.get(lfn, txn) | def get(self, lfn): current = self.db.get(lfn) if current is not None: return pickle.loads(current) else: return None | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py |
@with_transaction | def remove(self, txn, lfn): self.db.delete(lfn, txn) | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py | |
cur = self.db.cursor() | cur = self.db.cursor(txn) | def list(self): cur = self.db.cursor() try: result = [] current = cur.first() while current is not None: rec = pickle.loads(current[1]) rec['lfn'] = current[0] result.append(rec) current = cur.next() return result finally: cur.close() | 29dcac664c3f2fbc9009978e949ae467280aa521 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/29dcac664c3f2fbc9009978e949ae467280aa521/bdb.py |
def lookup(lfn): | def lookup(self, conn, lfn): | def lookup(lfn): cur = conn.cursor() cur.execute("select pfn from map where lfn=?",(lfn,)) pfns = [] for row in cur.fetchall(): pfns.append(row['pfn']) cur.close() return pfns | 6d1ce7533b0b5ddc33b669565f77b405949b61fe /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/6d1ce7533b0b5ddc33b669565f77b405949b61fe/db.py |
current = self.db.get(lfn, txn) | current = self.db.get(lfn, None, txn) | def get(self, txn, lfn): current = self.db.get(lfn, txn) if current is not None: return pickle.loads(current) else: return None | 05b4bdd65ddf75eb9be6dd90f51a8c2737df569b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11095/05b4bdd65ddf75eb9be6dd90f51a8c2737df569b/bdb.py |
@mockdata.check_http_method def _http_request(self, path, data=None, method=None, **kwargs): | def _http_request(self, path, data=None, method=None): | def __repr__(self): return '<MailmanRESTClient: %s>' % self.host | a73b2f832d063623dfaf85e3b60c20180665247c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2119/a73b2f832d063623dfaf85e3b60c20180665247c/mailman_rest_client.py |
:param data: POST, PUT or PATCH data to send | :param data: POST oder PUT data to send | def _http_request(self, path, data=None, method=None, **kwargs): """Send an HTTP request. :param path: the path to send the request to :type path: string :param data: POST, PUT or PATCH data to send :type data: dict :param method: the HTTP method; defaults to GET or POST (if data is not None) :type method: string :ret... | a73b2f832d063623dfaf85e3b60c20180665247c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2119/a73b2f832d063623dfaf85e3b60c20180665247c/mailman_rest_client.py |
data = urlencode(data) | data = urlencode(data, doseq=True) headers['Content-type'] = "application/x-www-form-urlencoded" | def _http_request(self, path, data=None, method=None, **kwargs): """Send an HTTP request. :param path: the path to send the request to :type path: string :param data: POST, PUT or PATCH data to send :type data: dict :param method: the HTTP method; defaults to GET or POST (if data is not None) :type method: string :ret... | a73b2f832d063623dfaf85e3b60c20180665247c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2119/a73b2f832d063623dfaf85e3b60c20180665247c/mailman_rest_client.py |
if method == 'POST': headers['Content-type'] = "application/x-www-form-urlencoded" | def _http_request(self, path, data=None, method=None, **kwargs): """Send an HTTP request. :param path: the path to send the request to :type path: string :param data: POST, PUT or PATCH data to send :type data: dict :param method: the HTTP method; defaults to GET or POST (if data is not None) :type method: string :ret... | a73b2f832d063623dfaf85e3b60c20180665247c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2119/a73b2f832d063623dfaf85e3b60c20180665247c/mailman_rest_client.py | |
def get_member(self, email_address, fqdn_listname): """Return a member object. :param email_adresses: the email address used :type email_address: string :param fqdn_listname: the mailing list :type fqdn_listname: string :return: a member object :rtype: _Member """ return _Member(self.host, email_address, fqdn_listname... | def get_member(self, email_address, fqdn_listname): """Return a member object. :param email_adresses: the email address used :type email_address: string :param fqdn_listname: the mailing list :type fqdn_listname: string :return: a member object :rtype: _Member """ return _Member(self.host, email_address, fqdn_listname... | a73b2f832d063623dfaf85e3b60c20180665247c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2119/a73b2f832d063623dfaf85e3b60c20180665247c/mailman_rest_client.py | |
@mockdata.add_list_mock_data | def delete_list(self, list_name): fqdn_listname = list_name + '@' + self.info['email_host'] return self._http_request('/3.0/lists/' + fqdn_listname, None, 'DELETE') | a73b2f832d063623dfaf85e3b60c20180665247c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2119/a73b2f832d063623dfaf85e3b60c20180665247c/mailman_rest_client.py | |
def get_member(self, email_address): """Return a member object. :param email_adresses: the email address used :type email_address: string :param fqdn_listname: the mailing list :type fqdn_listname: string :return: a member object :rtype: _Member """ return _Member(self.host, email_address, self.info['fqdn_listname'])... | def update_config(self, data): """Update the list configuration. :param data: A dict with the config attributes to be updated. :type data: dict :return: the return code of the http request :rtype: integer """ url = '/3.0/lists/%s/config' % self.info['fqdn_listname'] status = self._http_request(url, data, 'PATCH') if ... | def get_members(self): """Get a list of all list members. | a73b2f832d063623dfaf85e3b60c20180665247c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2119/a73b2f832d063623dfaf85e3b60c20180665247c/mailman_rest_client.py |
def avg (l): sum=0 for e in l: sum=sum+e; return sum/len(l) | 1423e3f7721b69cf594f13a198480eefa2e824de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7090/1423e3f7721b69cf594f13a198480eefa2e824de/regress.py | ||
print("-> glob_corr=%f\n" % glob_corr) | print("-> glob_corr={}\n".format(glob_corr)) | def correl_split_weighted( X , Y , segments ): # expects segments = [(0,i1-1),(i1-1,i2-1),(i2,len-1)] correl = list(); interv = list(); # regr. line coeffs and range glob_corr=0 sum_nb_val=0 for (start,stop) in segments: sum_nb_val = sum_nb_val + stop - start; #if start==stop : # return 0 S_XY= cov( X [start:stop+1], ... | 1423e3f7721b69cf594f13a198480eefa2e824de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7090/1423e3f7721b69cf594f13a198480eefa2e824de/regress.py |
readdata.append( (int(l[1]),float(l[3]) / 2 ) ); | readdata.append( (int(l[1]),float(l[3])) ); | def correl_split( X , Y , segments ): # expects segments = [(0,i1-1),(i1-1,i2-1),(i2,len-1)] correl = list(); interv = list(); # regr. line coeffs and range glob_corr=1 for (start,stop) in segments: #if start==stop : # return 0 S_XY= cov( X [start:stop+1], Y [start:stop+1] ) S_X2 = variance( X [start:stop+1] ) S_Y2 =... | 1423e3f7721b69cf594f13a198480eefa2e824de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7090/1423e3f7721b69cf594f13a198480eefa2e824de/regress.py |
print("** OPT: [%d .. %d]" % (i,j)) print("** Product of correl coefs = %f" % (max_glob_corr)) | print("** OPT: [%d .. %d] correl coef prod=%f slope: %f x + %f" % (i,j,max_glob_corr,a,b)) | def correl_split( X , Y , segments ): # expects segments = [(0,i1-1),(i1-1,i2-1),(i2,len-1)] correl = list(); interv = list(); # regr. line coeffs and range glob_corr=1 for (start,stop) in segments: #if start==stop : # return 0 S_XY= cov( X [start:stop+1], Y [start:stop+1] ) S_X2 = variance( X [start:stop+1] ) S_Y2 =... | 1423e3f7721b69cf594f13a198480eefa2e824de /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7090/1423e3f7721b69cf594f13a198480eefa2e824de/regress.py |
for i in xrange(n): | for i in range(n): | def cov (X, Y): assert len(X) == len(Y) n = len(X) # n=len(X)=len(Y) avg_X = avg(X) avg_Y = avg(Y) S_XY = 0.0 for i in xrange(n): S_XY += (X[i] - avg_X) * (Y[i] - avg_Y) return (S_XY / n) | f08c51969b477f4df715e6ed41846f01e52450a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7090/f08c51969b477f4df715e6ed41846f01e52450a7/calibrate_piecewise.py |
for i in xrange(n): | for i in range(n): | def variance (X): n = len(X) avg_X = avg (X) S_X2 = 0.0 for i in xrange(n): S_X2 += (X[i] - avg_X) ** 2 return (S_X2 / n) | f08c51969b477f4df715e6ed41846f01e52450a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7090/f08c51969b477f4df715e6ed41846f01e52450a7/calibrate_piecewise.py |
l = line.split(); if line[0] != ' | l = line.split(); if line[0] != ' | def calibrate (links, latency, bandwidth, sizes, timings): assert len(sizes) == len(timings) if len(sizes) < 2: return None S_XY = cov(sizes, timings) S_X2 = variance(sizes) a = S_XY / S_X2 b = avg(timings) - a * avg(sizes) return (b * 1e-6) / (latency * links), 1e6 / (a * bandwidth) | f08c51969b477f4df715e6ed41846f01e52450a7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7090/f08c51969b477f4df715e6ed41846f01e52450a7/calibrate_piecewise.py |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.