rem
stringlengths
1
226k
add
stringlengths
0
227k
context
stringlengths
6
326k
meta
stringlengths
143
403
input_ids
listlengths
256
256
attention_mask
listlengths
256
256
labels
listlengths
128
128
log.error("Error initializing plugin %r" % plugin)
log.error("Error initializing plugin %r" % plugin, exc_info=True)
def initialize(): config.addConfigDirsToPythonPackagePath(plugins) for plugin in listPlugins(): try: runningPlugins.add(plugin()) except: log.error("Error initializing plugin %r" % plugin)
8d00e0884d197f2b1c98a48ecb3d7762473131cc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9340/8d00e0884d197f2b1c98a48ecb3d7762473131cc/pluginHandler.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 13332, 642, 18, 1289, 809, 9872, 774, 15774, 2261, 743, 12, 8057, 13, 364, 1909, 316, 666, 9461, 13332, 775, 30, 3549, 9461, 18, 1289, 12, 4094, 10756, 1335, 30, 613, 18, 1636, 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, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 4046, 13332, 642, 18, 1289, 809, 9872, 774, 15774, 2261, 743, 12, 8057, 13, 364, 1909, 316, 666, 9461, 13332, 775, 30, 3549, 9461, 18, 1289, 12, 4094, 10756, 1335, 30, 613, 18, 1636, 2...
icsPayload.set_payload(m.data.encode('utf-8'))
icsPayload.set_payload(attachment.data.encode('utf-8'))
def kindToMessageObject(mailMessage): """ This method converts a email message string to a Chandler C{MailMessage} object @param mailMessage: A C{email.Message} object representation of a mail message @type mailMessage: C{email.Message} @return: C{Message.Message} """ assert has_stamp(mailMessage, MailStamp), \ "mailMessage must have been stamped as a MailStamp" messageObject = Message.Message() stampedMail = MailStamp(mailMessage) # Create a messageId if none exists if not hasValue(stampedMail.messageId): stampedMail.messageId = createMessageID() populateHeader(messageObject, 'Message-ID', stampedMail.messageId) populateHeader(messageObject, 'Date', stampedMail.dateSentString) populateEmailAddresses(stampedMail, messageObject) populateStaticHeaders(messageObject) populateHeaders(stampedMail, messageObject) populateHeader(messageObject, 'Subject', stampedMail.subject, encode=True) if getattr(stampedMail, "inReplyTo", None): populateHeader(messageObject, 'In-Reply-To', stampedMail.inReplyTo, encode=False) if stampedMail.referencesMID and len(stampedMail.referencesMID): messageObject["References"] = " ".join(stampedMail.referencesMID) try: payload = mailMessage.body except AttributeError: payload = u"" isEvent = has_stamp(mailMessage, EventStamp) hasAttachments = stampedMail.getNumberOfAttachments() > 0 if not isEvent and not hasAttachments: # There are no attachments or Ical events so just add the # body text as the payload and return the messageObject messageObject.set_payload(payload.encode("utf-8"), charset="utf-8") return messageObject messageObject.set_type("multipart/mixed") if isEvent: # If this message is an event, prepend the event description to the body, # and add the event data as an attachment. # @@@ This probably isn't the right place to do this (since it couples the # email service to events and ICalendarness), but until we resolve the architectural # questions around stamping, it's good enough. # It's an event - prepend the description to the body, make the # message multipart, and add the body & ICS event as parts. Also, # add a private header telling us how long the description is, so # we'll know what to remove on the receiving end. # @@@ I tried multipart/alternative here, but this hides the attachment # completely on some clients... # @@@ In formatting the prepended description, I'm adding an extra newline # at the end so that Apple Mail will display the .ics attachment on its own line. event = EventStamp(mailMessage) timeDescription = event.getTimeDescription() location = unicode(getattr(event, 'location', u'')) if len(location.strip()) > 0: evtDesc = _(u"When: %(whenValue)s\nWhere: %(locationValue)s") \ % { 'whenValue': timeDescription, 'locationValue': location } else: evtDesc = _(u"When: %(whenValue)s") \ % { 'whenValue': timeDescription } payload = _(u"%(eventDescription)s\n\n%(bodyText)s\n") \ % {'eventDescription': evtDesc, 'bodyText': payload } mt = email.MIMEText.MIMEText(payload.encode('utf-8'), _charset="utf-8") messageObject.attach(mt) messageObject.add_header(createChandlerHeader("EventDescriptionLength"), str(len(evtDesc))) # Format this message as an ICalendar object import osaf.sharing.ICalendar as ICalendar calendar = ICalendar.itemsToVObject(mailMessage.itsItem.itsView, [event], filters=(Remindable.reminders.name,)) calendar.add('method').value="REQUEST" ics = calendar.serialize().encode('utf-8') # Attach the ICalendar object icsPayload = MIMENonMultipart('text', 'calendar', method='REQUEST', _charset="utf-8") fname = Header.Header(_(u"event.ics")).encode() icsPayload.add_header("Content-Disposition", "attachment", filename=fname) icsPayload.set_payload(ics) messageObject.attach(icsPayload) else: mt = email.MIMEText.MIMEText(payload.encode('utf-8'), _charset="utf-8") messageObject.attach(mt) if hasAttachments: attachments = stampedMail.getAttachments() for attachment in attachments: if has_stamp(attachment, MailStamp): # The attachment is another MailMessage try: rfc2822 = binaryToData(MailStamp(attachment).rfc2822Message) except AttributeError: rfc2822 = kindToMessageText(attachment, False) message = email.message_from_string(rfc2822) rfc2822Payload = MIMEMessage(message) messageObject.attach(rfc2822Payload) else: m = email.MIMEText.MIMEText(attachment) if m.mimeType == u"text/calendar": icsPayload = MIMENonMultipart('text', 'calendar', \ method='REQUEST', _charset="utf-8") fname = Header.Header(m.filename).encode() icsPayload.add_header("Content-Disposition", "attachment", filename=fname) icsPayload.set_payload(m.data.encode('utf-8')) messageObject.attach(icsPayload) return messageObject
b824ffaa4bf208ea594a3c9dcb2a3bef9daae3c2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9228/b824ffaa4bf208ea594a3c9dcb2a3bef9daae3c2/message.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3846, 774, 1079, 921, 12, 4408, 1079, 4672, 3536, 1220, 707, 7759, 279, 2699, 883, 533, 358, 279, 1680, 464, 749, 385, 95, 6759, 1079, 97, 733, 225, 632, 891, 4791, 1079, 30, 432, 385,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3846, 774, 1079, 921, 12, 4408, 1079, 4672, 3536, 1220, 707, 7759, 279, 2699, 883, 533, 358, 279, 1680, 464, 749, 385, 95, 6759, 1079, 97, 733, 225, 632, 891, 4791, 1079, 30, 432, 385,...
self.assertRaises(OverflowError, long, float('inf')) self.assertEqual(long(float('nan')), 0L)
self.assertRaises(OverflowError, int, float('inf')) self.assertEqual(int(float('nan')), 0)
def test_nan_inf(self): self.assertRaises(OverflowError, long, float('inf')) self.assertEqual(long(float('nan')), 0L)
1aa7b30ba08ad18da57e22a45409604177b71847 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/8546/1aa7b30ba08ad18da57e22a45409604177b71847/test_long.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 13569, 67, 10625, 12, 2890, 4672, 365, 18, 11231, 12649, 6141, 12, 15526, 668, 16, 1525, 16, 1431, 2668, 10625, 26112, 365, 18, 11231, 5812, 12, 5748, 12, 5659, 2668, 13569, 61...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 13569, 67, 10625, 12, 2890, 4672, 365, 18, 11231, 12649, 6141, 12, 15526, 668, 16, 1525, 16, 1431, 2668, 10625, 26112, 365, 18, 11231, 5812, 12, 5748, 12, 5659, 2668, 13569, 61...
nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
nodelist = [] nodelist.extend(flatten_nodes(self.nodes)) return tuple(nodelist)
def getChildNodes(self): nodes = [] nodes.extend(flatten_nodes(self.nodes)) return tuple(nodes)
7dce7618a9a2ec21fadacd49967dbf4d460b4941 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/7dce7618a9a2ec21fadacd49967dbf4d460b4941/ast.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23895, 12, 2890, 4672, 2199, 273, 5378, 2199, 18, 14313, 12, 16940, 67, 4690, 12, 2890, 18, 4690, 3719, 327, 3193, 12, 4690, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 23895, 12, 2890, 4672, 2199, 273, 5378, 2199, 18, 14313, 12, 16940, 67, 4690, 12, 2890, 18, 4690, 3719, 327, 3193, 12, 4690, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
"""
"""
def fl_set_fselector_border(p1): """ fl_set_fselector_border(p1) """ _fl_set_fselector_border(p1)
9942dac8ce2b35a1e43615a26fd8e7054ef805d3 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/2429/9942dac8ce2b35a1e43615a26fd8e7054ef805d3/xformslib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1183, 67, 542, 67, 74, 9663, 67, 8815, 12, 84, 21, 4672, 3536, 1183, 67, 542, 67, 74, 9663, 67, 8815, 12, 84, 21, 13, 3536, 225, 389, 2242, 67, 542, 67, 74, 9663, 67, 8815, 12, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1183, 67, 542, 67, 74, 9663, 67, 8815, 12, 84, 21, 4672, 3536, 1183, 67, 542, 67, 74, 9663, 67, 8815, 12, 84, 21, 13, 3536, 225, 389, 2242, 67, 542, 67, 74, 9663, 67, 8815, 12, 8...
self.fillchar = ' '
self.fillchar = fillchar
def __init__(self, marker='#', left='|', right='|', fillchar=' '): self.marker = marker self.left = left self.right = right self.fillchar = ' '
103ebbb58636d065ba7441f5606ea8e1c2ab77d5 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11527/103ebbb58636d065ba7441f5606ea8e1c2ab77d5/progressbar.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5373, 2218, 7, 2187, 2002, 2218, 96, 2187, 2145, 2218, 96, 2187, 3636, 3001, 2218, 296, 4672, 365, 18, 11145, 273, 5373, 365, 18, 4482, 273, 2002, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5373, 2218, 7, 2187, 2002, 2218, 96, 2187, 2145, 2218, 96, 2187, 3636, 3001, 2218, 296, 4672, 365, 18, 11145, 273, 5373, 365, 18, 4482, 273, 2002, 365, 1...
fp1 = fp t0 = time.time() try: f.retrbinary('RETR ' + filename, fp1.write, 8*1024) except ftplib.error_perm, msg: print msg t1 = time.time() bytes = fp.tell() fp.close() if fp1 != fp: fp1.close()
try: fp = open(tempname, 'wb') except IOError, msg: print "Can't create %s: %s" % ( `tempname`, str(msg)) continue if verbose: print 'Retrieving %s from %s as %s...' % \ (`filename`, `pwd`, `fullname`) if verbose: fp1 = LoggingFile(fp, 1024, sys.stdout) else: fp1 = fp t0 = time.time() try: f.retrbinary('RETR ' + filename, fp1.write, 8*1024) except ftplib.error_perm, msg: print msg t1 = time.time() bytes = fp.tell() fp.close() if fp1 != fp: fp1.close()
def mirrorsubdir(f, localdir): pwd = f.pwd() if localdir and not os.path.isdir(localdir): if verbose: print 'Creating local directory', localdir try: makedir(localdir) except os.error, msg: print "Failed to establish local directory", localdir return infofilename = os.path.join(localdir, '.mirrorinfo') try: text = open(infofilename, 'r').read() except IOError, msg: text = '{}' try: info = eval(text) except (SyntaxError, NameError): print 'Bad mirror info in %s' % infofilename info = {} subdirs = [] listing = [] if verbose: print 'Listing remote directory %s...' % pwd f.retrlines('LIST', listing.append) filesfound = [] for line in listing: if verbose > 1: print '-->', `line` if mac: # Mac listing has just filenames; # trailing / means subdirectory filename = string.strip(line) mode = '-' if filename[-1:] == '/': filename = filename[:-1] mode = 'd' infostuff = '' else: # Parse, assuming a UNIX listing words = string.split(line, None, 8) if len(words) < 6: if verbose > 1: print 'Skipping short line' continue filename = words[-1] if string.find(filename, " -> ") >= 0: if verbose > 1: print 'Skipping symbolic link %s' % \ filename continue infostuff = words[-5:-1] mode = words[0] skip = 0 for pat in skippats: if fnmatch(filename, pat): if verbose > 1: print 'Skip pattern', pat, print 'matches', filename skip = 1 break if skip: continue if mode[0] == 'd': if verbose > 1: print 'Remembering subdirectory', filename subdirs.append(filename) continue filesfound.append(filename) if info.has_key(filename) and info[filename] == infostuff: if verbose > 1: print 'Already have this version of', filename continue fullname = os.path.join(localdir, filename) tempname = os.path.join(localdir, '@'+filename) if interactive: doit = askabout('file', filename, pwd) if not doit: if not info.has_key(filename): info[filename] = 'Not retrieved' continue try: os.unlink(tempname) except os.error: pass try: fp = open(tempname, 'wb') except IOError, msg: print "Can't create %s: %s" % (tempname, str(msg)) continue if verbose: print 'Retrieving %s from %s as %s...' % \ (filename, pwd, fullname) if verbose: fp1 = LoggingFile(fp, 1024, sys.stdout) else: fp1 = fp t0 = time.time() try: f.retrbinary('RETR ' + filename, fp1.write, 8*1024) except ftplib.error_perm, msg: print msg t1 = time.time() bytes = fp.tell() fp.close() if fp1 != fp: fp1.close() try: os.unlink(fullname) except os.error: pass # Ignore the error try: os.rename(tempname, fullname) except os.error, msg: print "Can't rename %s to %s: %s" % (tempname, fullname, str(msg)) continue info[filename] = infostuff writedict(info, infofilename) if verbose: dt = t1 - t0 kbytes = bytes / 1024.0 print int(round(kbytes)), print 'Kbytes in', print int(round(dt)), print 'seconds', if t1 > t0: print '(~%d Kbytes/sec)' % \ int(round(kbytes/dt),) print # # Remove files from info that are no longer remote deletions = 0 for filename in info.keys(): if filename not in filesfound: if verbose: print "Removing obsolete info entry for", print filename, "in", localdir or "." del info[filename] deletions = deletions + 1 if deletions: writedict(info, infofilename) # # Remove local files that are no longer in the remote directory try: if not localdir: names = os.listdir(os.curdir) else: names = os.listdir(localdir) except os.error: names = [] for name in names: if name[0] == '.' or info.has_key(name) or name in subdirs: continue skip = 0 for pat in skippats: if fnmatch(name, pat): if verbose > 1: print 'Skip pattern', pat, print 'matches', name skip = 1 break if skip: continue fullname = os.path.join(localdir, name) if not rmok: if verbose: print 'Local file', fullname, print 'is no longer pertinent' continue if verbose: print 'Removing local file/dir', fullname remove(fullname) # # Recursively mirror subdirectories for subdir in subdirs: if interactive: doit = askabout('subdirectory', subdir, pwd) if not doit: continue if verbose: print 'Processing subdirectory', subdir localsubdir = os.path.join(localdir, subdir) pwd = f.pwd() if verbose > 1: print 'Remote directory now:', pwd print 'Remote cwd', subdir try: f.cwd(subdir) except ftplib.error_perm, msg: print "Can't chdir to", subdir, ":", msg else: if verbose: print 'Mirroring as', localsubdir mirrorsubdir(f, localsubdir) if verbose > 1: print 'Remote cwd ..' f.cwd('..') newpwd = f.pwd() if newpwd != pwd: print 'Ended up in wrong directory after cd + cd ..' print 'Giving up now.' break else: if verbose > 1: print 'OK.'
b295df44a3cc9054e9b2a0ec48ba4f9c34fd0b88 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/b295df44a3cc9054e9b2a0ec48ba4f9c34fd0b88/ftpmirror.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 27026, 373, 1214, 12, 74, 16, 1191, 1214, 4672, 14720, 273, 284, 18, 27487, 1435, 309, 1191, 1214, 471, 486, 1140, 18, 803, 18, 291, 1214, 12, 3729, 1214, 4672, 309, 3988, 30, 117...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 312, 27026, 373, 1214, 12, 74, 16, 1191, 1214, 4672, 14720, 273, 284, 18, 27487, 1435, 309, 1191, 1214, 471, 486, 1140, 18, 803, 18, 291, 1214, 12, 3729, 1214, 4672, 309, 3988, 30, 117...
self.disconnect(viewer, qt.PYSIGNAL("mousePosition"),
self.disconnect(self.viewer, qt.PYSIGNAL("mousePosition"),
def disconnectViewer(self): viewer = self.parent().viewer self.disconnect(viewer, qt.PYSIGNAL("mousePressed"), self.mousePressed) self.disconnect(viewer, qt.PYSIGNAL("mousePosition"), self.mouseMoved) self.disconnect(viewer, qt.PYSIGNAL("mouseReleased"), self.mouseReleased) self.disconnect(self.viewer, qt.PYSIGNAL("mouseDoubleClicked"), self.mouseDoubleClicked) self.viewer.removeOverlay(self.overlayIndex)
65254bc446b7c353066fe806e0424030a38d558d /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10394/65254bc446b7c353066fe806e0424030a38d558d/tools.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9479, 18415, 12, 2890, 4672, 14157, 273, 365, 18, 2938, 7675, 25256, 365, 18, 20177, 12, 25256, 16, 25672, 18, 16235, 11260, 1013, 2932, 11697, 24624, 6, 3631, 365, 18, 11697, 24624, 13, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 9479, 18415, 12, 2890, 4672, 14157, 273, 365, 18, 2938, 7675, 25256, 365, 18, 20177, 12, 25256, 16, 25672, 18, 16235, 11260, 1013, 2932, 11697, 24624, 6, 3631, 365, 18, 11697, 24624, 13, ...
else
else:
def __init__(data = None) if data == None: quickfix.CharField.__init__(self, 544) else quickfix.CharField.__init__(self, 544, data)
484890147d4b23aac4b9d0e85e84fceab7e137c3 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8819/484890147d4b23aac4b9d0e85e84fceab7e137c3/quickfix_fields.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 2156, 974, 16186, 2738, 972, 12, 2890, 16, 1381, 6334, 13, 469, 30, 9549, 904, 18, 2156, 974, 16186, 27...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 892, 273, 599, 13, 309, 501, 422, 599, 30, 9549, 904, 18, 2156, 974, 16186, 2738, 972, 12, 2890, 16, 1381, 6334, 13, 469, 30, 9549, 904, 18, 2156, 974, 16186, 27...
self.done_chars = ('/',',',';','.')
self.done_chars = ('/', ',', ';', '.')
def __init__(self, routepath, **kargs): """Initialize a route, with a given routepath for matching/generation The set of keyword args will be used as defaults. Usage:: >>> from routes.base import Route >>> newroute = Route(':controller/:action/:id') >>> newroute.defaults {'action': 'index', 'id': None} >>> newroute = Route('date/:year/:month/:day', controller="blog", action="view") >>> newroute = Route('archives/:page', controller="blog", action="by_page", requirements = { 'page':'\d{1,2}' }) >>> newroute.reqs {'page': '\\\d{1,2}'} .. Note:: Route is generally not called directly, a Mapper instance connect method should be used to add routes. """ self.routepath = routepath self.sub_domains = False self.prior = None # Don't bother forming stuff we don't need if its a static route self.static = kargs.get('_static', False) self.filter = kargs.pop('_filter', None) self.absolute = kargs.pop('_absolute', False) # Pull out route conditions self.conditions = kargs.pop('conditions', None) # Determine if explicit behavior should be used self.explicit = kargs.pop('_explicit', False) # reserved keys that don't count reserved_keys = ['requirements'] # special chars to indicate a natural split in the URL self.done_chars = ('/',',',';','.') # Strip preceding '/' if present if routepath.startswith('/'): routepath = routepath[1:] # Build our routelist, and the keys used in the route self.routelist = routelist = self._pathkeys(routepath) routekeys = frozenset([key['name'] for key in routelist if isinstance(key, dict)]) # Build a req list with all the regexp requirements for our args self.reqs = kargs.get('requirements', {}) self.req_regs = {} for key,val in self.reqs.iteritems(): self.req_regs[key] = re.compile('^' + val + '$') # Update our defaults and set new default keys if needed. defaults needs to be saved (self.defaults, defaultkeys) = self._defaults(routekeys, reserved_keys, kargs) # Save the maximum keys we could utilize self.maxkeys = defaultkeys | routekeys # Populate our minimum keys, and save a copy of our backward keys for quicker generation later (self.minkeys, self.routebackwards) = self._minkeys(routelist[:]) # Populate our hardcoded keys, these are ones that are set and don't exist in the route self.hardcoded = frozenset([key for key in self.maxkeys \ if key not in routekeys and self.defaults[key] is not None])
52ae2d9eaabbf5ff009086347bb090d7048fa505 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12081/52ae2d9eaabbf5ff009086347bb090d7048fa505/base.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1946, 803, 16, 2826, 79, 1968, 4672, 3536, 7520, 279, 1946, 16, 598, 279, 864, 1946, 803, 364, 3607, 19, 25514, 225, 1021, 444, 434, 4932, 833, 903, 506,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1946, 803, 16, 2826, 79, 1968, 4672, 3536, 7520, 279, 1946, 16, 598, 279, 864, 1946, 803, 364, 3607, 19, 25514, 225, 1021, 444, 434, 4932, 833, 903, 506,...
if 0: import pywintypes from win32api import GetStdHandle, STD_INPUT_HANDLE, \ STD_OUTPUT_HANDLE, STD_ERROR_HANDLE from win32api import GetCurrentProcess, DuplicateHandle, \ GetModuleFileName, GetVersion from win32con import DUPLICATE_SAME_ACCESS, SW_HIDE from win32pipe import CreatePipe from win32process import CreateProcess, STARTUPINFO, \ GetExitCodeProcess, STARTF_USESTDHANDLES, \ STARTF_USESHOWWINDOW, CREATE_NEW_CONSOLE from win32process import TerminateProcess from win32event import WaitForSingleObject, INFINITE, WAIT_OBJECT_0 else: from _subprocess import * class STARTUPINFO: dwFlags = 0 hStdInput = None hStdOutput = None hStdError = None wShowWindow = 0 class pywintypes: error = IOError
import _subprocess class STARTUPINFO: dwFlags = 0 hStdInput = None hStdOutput = None hStdError = None wShowWindow = 0 class pywintypes: error = IOError
def __str__(self): return "Command '%s' returned non-zero exit status %d" % (self.cmd, self.returncode)
7d139c76c8e23ecba07fdb99f6a8ba8c60fd6097 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/7d139c76c8e23ecba07fdb99f6a8ba8c60fd6097/subprocess.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 327, 315, 2189, 1995, 87, 11, 2106, 1661, 17, 7124, 2427, 1267, 738, 72, 6, 738, 261, 2890, 18, 4172, 16, 365, 18, 2463, 710, 13, 2, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 701, 972, 12, 2890, 4672, 327, 315, 2189, 1995, 87, 11, 2106, 1661, 17, 7124, 2427, 1267, 738, 72, 6, 738, 261, 2890, 18, 4172, 16, 365, 18, 2463, 710, 13, 2, -100, -100, -100,...
def start(self): result = self.get_string("getNewBrowserSession", [self.browserStartCommand, self.browserURL, self.extensionJs])
def start(self, browserConfigurationOptions=None): start_args = [self.browserStartCommand, self.browserURL, self.extensionJs] if browserConfigurationOptions: start_args.append(browserConfigurationOptions) result = self.get_string("getNewBrowserSession", start_args)
def start(self): result = self.get_string("getNewBrowserSession", [self.browserStartCommand, self.browserURL, self.extensionJs]) try: self.sessionId = result except ValueError: raise Exception, result
7bf46b69d3aa674906df7294a90b9c456573c4cd /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/3504/7bf46b69d3aa674906df7294a90b9c456573c4cd/selenium.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12, 2890, 16, 4748, 1750, 1320, 33, 7036, 4672, 787, 67, 1968, 273, 306, 2890, 18, 11213, 1685, 2189, 16, 365, 18, 11213, 1785, 16, 365, 18, 6447, 8382, 65, 309, 4748, 1750, 1320,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 12, 2890, 16, 4748, 1750, 1320, 33, 7036, 4672, 787, 67, 1968, 273, 306, 2890, 18, 11213, 1685, 2189, 16, 365, 18, 11213, 1785, 16, 365, 18, 6447, 8382, 65, 309, 4748, 1750, 1320,...
print " <3> Value 1:", value1, " : ", rowcounter1
print "Value 1:", value1, " : ", rowcounter1
def find_start_stop_index(data_dict,col_name,start_data,stop_data,start_comp,stop_comp,ind_scale): #This function is used to find index numbers for start and stop points in plotting and metric values. if diagnostic_level >= 2: print "\n*** Find Start/End Indexes for Independent Data Column ***" if diagnostic_level >= 3: print " <3> Start Data:", start_data print " <3> Stop Data:", stop_data print " <3> Independent Data Scale Factor:", ind_scale if diagnostic_level >= 2: print "Independent Data Column name:", col_name if diagnostic_level >= 3: print " <3> Independent Data Column Data:", data_dict[col_name] ## Find Start Value Index Number rowcounter1 = 0 if diagnostic_level >= 2: print "*** Finding Independent Data Column Start Index ***" for value1 in data_dict[col_name]: if diagnostic_level >= 3: print " <3> Value 1:", value1, " : ", rowcounter1 if value1 == 'Null': continue else: if value1 >= (float(start_data)*float(ind_scale)): if diagnostic_level >= 3: print " <3> Independent Data Column Starts at row #:", str(rowcounter1) print " <3> With a value of:", str(value1) ind_col_start_index = rowcounter1 break rowcounter1 = rowcounter1 + 1 ## Find End of Independent Data Column, then Index Value rowcounter2 = 0 end_index = 0 index_count = 0 if diagnostic_level >= 2: print "*** Finding Index of last good value in Independent Data Column ***" for end_data_index in data_dict[col_name]: if diagnostic_level >= 3: print " <3> ", end_data_index, " : ", index_count if end_data_index == 'Null': end_index = index_count - 1 break else: index_count = index_count + 1 if end_index == 0: end_index = index_count - 1 if diagnostic_level >= 3: print " <3> Length of Independent Data Column:", end_index + 1 print " <3> Last value in Independent Data Column:", data_dict[col_name][end_index] print " <3> Index of Last Numeric Value:", end_index if diagnostic_level >= 2: print "*** Finding Independent Data Column End Index ***" for value2 in data_dict[col_name]: if diagnostic_level >= 3: print "Value 2:", value2, " : ", rowcounter2 if float(data_dict[col_name][end_index]) < (float(stop_data)*float(ind_scale)): if diagnostic_level >= 2: print "Specified end of Independent Data Column Data is greater than end of time in the data set. \nUsing last value in the Independent Data Column.\n" print "Value used is: "+str(float(data_dict[col_name][end_index]))+"\n" ind_col_end_index = (end_index) break if value2 < (float(stop_data)*float(ind_scale)): rowcounter2 = rowcounter2 + 1 else: row_number2 = (rowcounter2) - 1 if diagnostic_level >= 2: print "Independent Data Column Ends at Index #: ", str(row_number2), "with a value of: ", str(data_dict[col_name][row_number2]) ind_col_end_index = row_number2 break #Find Comparison Start Index for Independent Data rowcounter3 = 0 if diagnostic_level >= 2: print "*** Finding Start Index for Metric Data ***" for value3 in data_dict[col_name]: if diagnostic_level >= 3: print "Value 3:", value3, " : ", rowcounter3 if value3 >= (float(start_comp)*float(ind_scale)): if diagnostic_level >= 2: print "Metric Data starts at Index #:", str(rowcounter3), "with a value of:", str(value3) metric_start_index = rowcounter3 break rowcounter3 = rowcounter3 + 1 #Find Comparison End Index for Independent Data rowcounter4 = 0 if diagnostic_level >= 2: print "*** Finding End Index for Metric Data ***" for value4 in data_dict[col_name]: scaled_stop_value = (float(stop_comp)*float(ind_scale)) end_index_value = float(data_dict[col_name][end_index]) if diagnostic_level >= 3: print " <3> Scaled Stop Value and End Index Value:", scaled_stop_value, " : ",end_index_value if end_index_value < scaled_stop_value: if diagnostic_level >= 2: print "Specified end of Metric data is greater than last value in the Independent Data Column.\nUsing last value in the Independent Data Column.\n" print "Metric Data ends at Index #:", str(end_index), "with a value of: ", str(end_index_value) metric_end_index = end_index break else: if diagnostic_level >= 3: print "Value 4:", value4, " : ", rowcounter4 if value4 < scaled_stop_value: rowcounter4 = rowcounter4 + 1 if value4 >= scaled_stop_value: if value4 == scaled_stop_value: row_number4 = rowcounter4 if diagnostic_level >= 2: print "Comparison Ends at Index #:", str(row_number4), "with a value of: ", str(data_dict[col_name][row_number4]) metric_end_index = row_number4 break else: row_number4 = rowcounter4 - 1 if diagnostic_level >= 2: print "Comparison Ends at Index #:", str(row_number4), "with a value of: ", str(data_dict[col_name][row_number4]) metric_end_index = row_number4 break if diagnostic_level >= 2: print "\n*** Start/End Indexes Found ***" print "Independent Data Col Start Index:", ind_col_start_index print "Independent Data Col End Index:", ind_col_end_index print "Metric Start Index:", metric_start_index print "Metric End Index:", metric_end_index, "\n" return (ind_col_start_index, ind_col_end_index, metric_start_index, metric_end_index)
f66ca75013a32a9d59d8e58dec0baa78eda49b79 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12/f66ca75013a32a9d59d8e58dec0baa78eda49b79/Validation_Data_Processor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 1937, 67, 5681, 67, 1615, 12, 892, 67, 1576, 16, 1293, 67, 529, 16, 1937, 67, 892, 16, 5681, 67, 892, 16, 1937, 67, 2919, 16, 5681, 67, 2919, 16, 728, 67, 5864, 4672, 468...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1104, 67, 1937, 67, 5681, 67, 1615, 12, 892, 67, 1576, 16, 1293, 67, 529, 16, 1937, 67, 892, 16, 5681, 67, 892, 16, 1937, 67, 2919, 16, 5681, 67, 2919, 16, 728, 67, 5864, 4672, 468...
is typeset on its own line, with the string sep typeset between
is typeset on its own line, with the string sep inserted between
def view(objects, title='SAGE', zoom=4, expert=True, debug=False, \ sep='', tiny=False, **kwds): r""" Compute a latex representation of each object in objects, compile, and display typeset. If used from the command line, this requires that latex be installed. INPUT: - ``objects`` - list (or object) - ``title`` - string (default: 'Sage'): title for the document - ``zoom`` - zoom factor, passed on to xdvi if used - ``expert`` - bool (default: True): mode passed on to xdvi - ``debug`` - bool (default: False): print verbose output - ``sep`` - string (default: ''): separator between math objects - ``tiny`` - bool (default: False): use tiny font. OUTPUT: Display typeset objects. This function behaves differently depending on whether in notebook mode or not. If not in notebook mode, this opens up a window displaying a dvi (or pdf) file, displaying the following: the title string is printed, centered, at the top. Beneath that, each object in objects is typeset on its own line, with the string sep typeset between these lines. If the program xdvi is used to display the dvi file, then the values of expert and zoom are passed on to it. On OS X displays a pdf. If in notebook mode, this uses jmath to display the output in the notebook. Only the first argument, objects, is relevant; the others are ignored. If objects is a list, the result is typeset as a Python list, e.g. [12, -3.431] - each object in the list is not printed on its own line. EXAMPLES:: sage: sage.misc.latex.EMBEDDED_MODE=True sage: view(3) <html><span class="math">3</span></html> sage: sage.misc.latex.EMBEDDED_MODE=False """ if EMBEDDED_MODE: print typeset(objects) return if isinstance(objects, LatexExpr): s = str(objects) else: s = _latex_file_(objects, title=title, expert=expert, debug=debug, sep=sep, tiny=tiny) from sage.misc.viewer import dvi_viewer viewer = dvi_viewer() tmp = tmp_dir('sage_viewer') open('%s/sage.tex'%tmp,'w').write(s) os.system('ln -sf %s/common/macros.tex %s'%(SAGE_DOC, tmp)) O = open('%s/go'%tmp,'w') #O.write('export TEXINPUTS=%s/doc/commontex:.\n'%SAGE_ROOT) # O.write('latex \\\\nonstopmode \\\\input{sage.tex}; xdvi -noscan -offsets 0.3 -paper 100000x100000 -s %s sage.dvi ; rm sage.* macros.* go ; cd .. ; rmdir %s'%(zoom,tmp)) # Added sleep 1 to allow viewer to open the file before it gets removed # Yi Qiang 2008-05-09 O.write('latex \\\\nonstopmode \\\\input{sage.tex}; %s sage.dvi ; sleep 1 rm sage.* macros.* go ; cd .. ; rmdir %s' % (viewer, tmp)) O.close() if not debug: direct = '1>/dev/null 2>/dev/null' else: direct = '' os.system('cd %s; chmod +x go; ./go %s&'%(tmp,direct)) #return os.popen('cd %s; chmod +x go; ./go %s & '%(tmp,direct), 'r').read()
88f181ebfaad90b3a700e33de9f4a5e890bcb85c /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/88f181ebfaad90b3a700e33de9f4a5e890bcb85c/latex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1476, 12, 6911, 16, 2077, 2218, 55, 2833, 2187, 7182, 33, 24, 16, 431, 672, 33, 5510, 16, 1198, 33, 8381, 16, 521, 5478, 2218, 2187, 24405, 33, 8381, 16, 225, 2826, 25577, 4672, 436, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1476, 12, 6911, 16, 2077, 2218, 55, 2833, 2187, 7182, 33, 24, 16, 431, 672, 33, 5510, 16, 1198, 33, 8381, 16, 521, 5478, 2218, 2187, 24405, 33, 8381, 16, 225, 2826, 25577, 4672, 436, ...
default="10",
default="1",
def parse_opts(args): parser = optparse.OptionParser() parser.add_option("--db_user", action="store", type="string",dest="db_user", default="root", help="Username for database") parser.add_option("--db_password", action="store", type="string",dest="db_password", default="", help="Password for database") parser.add_option("--db_host", action="store", type="string",dest="db_host", default="", help="Hostname for database") parser.add_option("--db_socket", action="store", type="string",dest="db_socket", default="", help="Socket for database") parser.add_option("--db_name", action="store", type="string",dest="db_name", default="test", help="Database name") parser.add_option("--engine", action="store", type="string",dest="engine", default="innodb", help="Database engine") parser.add_option("--threads", action="store", type="int", dest="threads", default="1", help="Number of concurrent connections") parser.add_option("--loops", action="store", type="int", dest="loops", default="10", help="Number of times a query is repeated") parser.add_option("--scale_factor", action="store", type="int", dest="scale_factor", default="1", help="Base tables have 10,000 * scale_factor rows") parser.add_option("--prepare", action="store_true", default=False, dest="prepare", help="Setup the test tables") parser.add_option("--debug_query", action="store_true", default=False, dest="debug_query", help="Check query results") parser.add_option("--index_after_load", action="store_true", default=False, dest="index_after_load", help="Create indexes on the test tables") # TODO parser.add_option('--complex_query', action='store_true', default=False, dest='complex_query', help='Use queries with a complex where clause. ' 'Not implemented yet.') return parser.parse_args(args)
8d9ef07d40468b850be71a6000bdfde339697c48 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/3908/8d9ef07d40468b850be71a6000bdfde339697c48/wisc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 4952, 12, 1968, 4672, 2082, 273, 2153, 2670, 18, 1895, 2678, 1435, 2082, 18, 1289, 67, 3482, 2932, 413, 1966, 67, 1355, 3113, 1301, 1546, 2233, 3113, 618, 1546, 1080, 3113, 104...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1109, 67, 4952, 12, 1968, 4672, 2082, 273, 2153, 2670, 18, 1895, 2678, 1435, 2082, 18, 1289, 67, 3482, 2932, 413, 1966, 67, 1355, 3113, 1301, 1546, 2233, 3113, 618, 1546, 1080, 3113, 104...
sys.stdout.flush()
def test_main(): rootLogger = logging.getLogger("") rootLogger.setLevel(logging.DEBUG) hdlr = logging.StreamHandler(sys.stdout) fmt = logging.Formatter(logging.BASIC_FORMAT) hdlr.setFormatter(fmt) rootLogger.addHandler(hdlr) #Set up a handler such that all events are sent via a socket to the log #receiver (logrecv). #The handler will only be added to the rootLogger for some of the tests hdlr = logging.handlers.SocketHandler('localhost', logging.handlers.DEFAULT_TCP_LOGGING_PORT) #Configure the logger for logrecv so events do not propagate beyond it. #The sockLogger output is buffered in memory until the end of the test, #and printed at the end. sockOut = cStringIO.StringIO() sockLogger = logging.getLogger("logrecv") sockLogger.setLevel(logging.DEBUG) sockhdlr = logging.StreamHandler(sockOut) sockhdlr.setFormatter(logging.Formatter( "%(name)s -> %(levelname)s: %(message)s")) sockLogger.addHandler(sockhdlr) sockLogger.propagate = 0 #Set up servers threads = [] tcpserver = LogRecordSocketReceiver() sys.stdout.write("About to start TCP server...\n") threads.append(threading.Thread(target=runTCP, args=(tcpserver,))) for thread in threads: thread.start() try: banner("log_test0", "begin") rootLogger.addHandler(hdlr) test0() rootLogger.removeHandler(hdlr) banner("log_test0", "end") banner("log_test1", "begin") test1() banner("log_test1", "end") banner("log_test2", "begin") test2() banner("log_test2", "end") banner("log_test3", "begin") test3() banner("log_test3", "end") banner("logrecv output", "begin") sys.stdout.write(sockOut.getvalue()) sockOut.close() banner("logrecv output", "end") finally: #shut down server tcpserver.abort = 1 for thread in threads: thread.join()
0844d53e3656902c7bcae91b70ecad553c369283 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12029/0844d53e3656902c7bcae91b70ecad553c369283/test_logging.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 5254, 13332, 1365, 3328, 273, 2907, 18, 588, 3328, 2932, 7923, 1365, 3328, 18, 542, 2355, 12, 11167, 18, 9394, 13, 366, 5761, 86, 273, 2907, 18, 1228, 1503, 12, 9499, 18, 102...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5254, 13332, 1365, 3328, 273, 2907, 18, 588, 3328, 2932, 7923, 1365, 3328, 18, 542, 2355, 12, 11167, 18, 9394, 13, 366, 5761, 86, 273, 2907, 18, 1228, 1503, 12, 9499, 18, 102...
from os2 import stat, getcwd
from os2 import stat, getcwd, environ, listdir
def _os_bootstrap(): "Set up 'os' module replacement functions for use during import bootstrap." global _os_stat, _os_path_join, _os_path_dirname, _os_getcwd names = sys.builtin_module_names join = dirname = None mindirlen = 0 if 'posix' in names: from posix import stat, getcwd sep = '/' mindirlen = 1 elif 'nt' in names: from nt import stat, getcwd sep = '\\' mindirlen = 3 elif 'dos' in names: from dos import stat, getcwd sep = '\\' mindirlen = 3 elif 'os2' in names: from os2 import stat, getcwd sep = '\\' elif 'mac' in names: from mac import stat, getcwd def join(a, b): if a == '': return b path = s if ':' not in a: a = ':' + a if a[-1:] != ':': a = a + ':' return a + b else: raise ImportError, 'no os specific module found' if join is None: def join(a, b, sep=sep): if a == '': return b lastchar = a[-1:] if lastchar == '/' or lastchar == sep: return a + b return a + sep + b if dirname is None: def dirname(a, sep=sep, mindirlen=mindirlen): for i in range(len(a)-1, -1, -1): c = a[i] if c == '/' or c == sep: if i < mindirlen: return a[:i+1] return a[:i] return '' _os_stat = stat _os_getcwd = getcwd _os_path_join = join _os_path_dirname = dirname
59d55e3eafa5f2caeb1279be446bd3e94a5799a4 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/11925/59d55e3eafa5f2caeb1279be446bd3e94a5799a4/iu.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 538, 67, 12722, 13332, 315, 694, 731, 296, 538, 11, 1605, 6060, 4186, 364, 999, 4982, 1930, 7065, 1199, 225, 2552, 389, 538, 67, 5642, 16, 389, 538, 67, 803, 67, 5701, 16, 389, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 538, 67, 12722, 13332, 315, 694, 731, 296, 538, 11, 1605, 6060, 4186, 364, 999, 4982, 1930, 7065, 1199, 225, 2552, 389, 538, 67, 5642, 16, 389, 538, 67, 803, 67, 5701, 16, 389, ...
listh = 0
listh = 24*7
def maketimejumpboxday(self, gstart): retval='<select name="day">\n' myt = time.time() myt_t = time.localtime(myt) gstart_t = time.localtime(gstart) myt = time.mktime((myt_t[0], myt_t[1], myt_t[2], 0, 0, 5, myt_t[6], myt_t[7], -1)) # listh = tv_util.when_listings_expire() listh = 0 if listh == 0: return retval + '</select>\n' listd = int((listh/24)+2) for i in range(1, listd): retval += '<option value="' + str(myt) + '"' myt_t = time.localtime(myt) if (myt_t[0] == gstart_t[0] and \ myt_t[1] == gstart_t[1] and \ myt_t[2] == gstart_t[2]): retval += ' SELECTED ' retval += '>' + time.strftime('%a %b %d', myt_t) + '\n' myt += 60*60*24 retval += '</select>\n' return retval
76ef10210f2f68f17d5908489b222a47c8e3d112 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/76ef10210f2f68f17d5908489b222a47c8e3d112/guide.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29796, 2374, 24574, 2147, 2881, 12, 2890, 16, 314, 1937, 4672, 5221, 2218, 32, 4025, 508, 1546, 2881, 6, 5333, 82, 11, 3399, 88, 273, 813, 18, 957, 1435, 3399, 88, 67, 88, 273, 813, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 29796, 2374, 24574, 2147, 2881, 12, 2890, 16, 314, 1937, 4672, 5221, 2218, 32, 4025, 508, 1546, 2881, 6, 5333, 82, 11, 3399, 88, 273, 813, 18, 957, 1435, 3399, 88, 67, 88, 273, 813, ...
self.s_apply(self.r_eval, args)
return self.s_apply(self.r_eval, args)
def s_eval(self, *args): self.s_apply(self.r_eval, args)
183a2f243768ffd15ff4324b317ba880da1094ef /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8546/183a2f243768ffd15ff4324b317ba880da1094ef/rexec.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 67, 8622, 12, 2890, 16, 380, 1968, 4672, 365, 18, 87, 67, 9010, 12, 2890, 18, 86, 67, 8622, 16, 833, 13, 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, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 67, 8622, 12, 2890, 16, 380, 1968, 4672, 365, 18, 87, 67, 9010, 12, 2890, 18, 86, 67, 8622, 16, 833, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
translation = outtxt
translation = outtxt.decode('utf-8')
def processElementTag(node, replacements, restart = 0): """Process node with node.type == 'element'.""" if node.type == 'element': # Translate attributes if needed if node.properties and len(treated_attributes): for p in node.properties: if p.name in treated_attributes: processAttribute(node, p) outtxt = '' if restart: myrepl = [] else: myrepl = replacements submsgs = [] child = node.children while child: if (isFinalNode(child)) or (child.type == 'element' and worthOutputting(child)): myrepl.append(processElementTag(child, myrepl, 1)) outtxt += '<placeholder-%d/>' % (len(myrepl)) else: if child.type == 'element': (starttag, content, endtag, translation) = processElementTag(child, myrepl, 0) outtxt += '<%s>%s</%s>' % (starttag, content, endtag) else: outtxt += doSerialize(child) child = child.next if mode == 'merge': translation = getTranslation(outtxt, isSpacePreserveNode(node)) else: translation = outtxt starttag = startTagForNode(node) endtag = endTagForNode(node) worth = worthOutputting(node) if not translation: translation = outtxt.decode('utf-8') if worth and mark_untranslated: node.setLang('C') if restart or worth: i = 0 while i < len(myrepl): replacement = '<%s>%s</%s>' % (myrepl[i][0], myrepl[i][3], myrepl[i][2]) i += 1 translation = translation.replace('<placeholder-%d/>' % (i), replacement) if worth: if mode == 'merge': replaceNodeContentsWithText(node, translation) else: msg.outputMessage(outtxt, node.lineNo(), getCommentForNode(node), isSpacePreserveNode(node), tag = node.name) return (starttag, outtxt, endtag, translation) else: raise Exception("You must pass node with node.type=='element'.")
a896a2df2e2a6a7ac2413df2403b68f202d54f90 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/11802/a896a2df2e2a6a7ac2413df2403b68f202d54f90/xml2po.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 1046, 1805, 12, 2159, 16, 11413, 16, 7870, 273, 374, 4672, 3536, 2227, 756, 598, 756, 18, 723, 422, 296, 2956, 11, 12123, 309, 756, 18, 723, 422, 296, 2956, 4278, 468, 16820, 167...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1207, 1046, 1805, 12, 2159, 16, 11413, 16, 7870, 273, 374, 4672, 3536, 2227, 756, 598, 756, 18, 723, 422, 296, 2956, 11, 12123, 309, 756, 18, 723, 422, 296, 2956, 4278, 468, 16820, 167...
document.body[i:k+1] = subst
document.body[i:k + 1] = subst
def revert_printindexall(document): " Reverts \\print[sub]index* CommandInset types " i = find_token(document.header, '\\use_indices', 0) if i == -1: document.warning("Malformed LyX document: Missing \\use_indices.") return indices = get_value(document.header, "\\use_indices", i) i = 0 while True: i = find_token(document.body, "\\begin_inset CommandInset index_print", i) if i == -1: return k = find_end_of_inset(document.body, i) ctype = get_value(document.body, 'LatexCommand', i, k) if ctype != "printindex*" and ctype != "printsubindex*": i = i + 1 continue if indices == "false": del document.body[i:k+1] else: subst = [old_put_cmd_in_ert("\\" + ctype + "{}")] document.body[i:k+1] = subst i = i + 1
bcd8b9a1f1241c461beb5db1d5a69424a9a25950 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7514/bcd8b9a1f1241c461beb5db1d5a69424a9a25950/lyx_2_0.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 1188, 1615, 454, 12, 5457, 4672, 315, 868, 31537, 1736, 1188, 63, 1717, 65, 1615, 14, 3498, 382, 542, 1953, 315, 277, 273, 1104, 67, 2316, 12, 5457, 18, 3374, 16, 3718, 1202...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 15226, 67, 1188, 1615, 454, 12, 5457, 4672, 315, 868, 31537, 1736, 1188, 63, 1717, 65, 1615, 14, 3498, 382, 542, 1953, 315, 277, 273, 1104, 67, 2316, 12, 5457, 18, 3374, 16, 3718, 1202...
sim.getRNG().setSeed(12345)
sim.getRNG().set(seed=12345)
def avgAllele(pop): 'Get average allele by affection sim.status.' sim.stat(pop, alleleFreq=(0,1), subPops=[(0,0), (0,1)], numOfAffected=True, vars=['alleleNum', 'alleleNum_sp']) avg = [] for alleleNum in [\ pop.dvars((0,0)).alleleNum[0], # first locus, unaffected pop.dvars((0,1)).alleleNum[0], # first locus, affected pop.dvars().alleleNum[1], # second locus, overall ]: alleleSum = numAllele = 0 for idx,cnt in enumerate(alleleNum): alleleSum += idx * cnt numAllele += cnt if numAllele == 0: avg.append(0) else: avg.append(alleleSum * 1.0 /numAllele) # unaffected, affected, loc2 pop.dvars().avgAllele = avg return True
205f55f8c6cd28aed704d70838912648f07ac340 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/401/205f55f8c6cd28aed704d70838912648f07ac340/userGuide.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11152, 1595, 6516, 12, 5120, 4672, 296, 967, 8164, 14551, 635, 7103, 794, 3142, 18, 2327, 1093, 3142, 18, 5642, 12, 5120, 16, 14551, 14485, 28657, 20, 16, 21, 3631, 720, 52, 4473, 22850,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11152, 1595, 6516, 12, 5120, 4672, 296, 967, 8164, 14551, 635, 7103, 794, 3142, 18, 2327, 1093, 3142, 18, 5642, 12, 5120, 16, 14551, 14485, 28657, 20, 16, 21, 3631, 720, 52, 4473, 22850,...
gdata_tests.sites.live_client_test..suite(),
gdata_tests.sites.live_client_test.suite(),
def suite(): return unittest.TestSuite(( atom_tests.core_test.suite(), atom_tests.data_test.suite(), atom_tests.http_core_test.suite(), atom_tests.auth_test.suite(), atom_tests.mock_http_core_test.suite(), atom_tests.client_test.suite(), gdata_tests.client_test.suite(), gdata_tests.data_test.suite(), gdata_tests.data_smoke_test.suite(), gdata_tests.live_client_test.suite(), gdata_tests.gauth_test.suite(), gdata_tests.blogger.data_test.suite(), gdata_tests.blogger.live_client_test.suite(), gdata_tests.maps.data_test.suite(), gdata_tests.maps.live_client_test.suite(), gdata_tests.spreadsheets.data_test.suite(), gdata_tests.spreadsheets.live_client_test.suite(), gdata_tests.projecthosting.data_test.suite(), gdata_tests.projecthosting.live_client_test.suite(), gdata_tests.sites.data_test.suite(), gdata_tests.sites.live_client_test..suite(), gdata_tests.contacts.live_client_test.suite(),))
aae8d597ff86bace6960fd9c0d07cd32a4f9c378 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6580/aae8d597ff86bace6960fd9c0d07cd32a4f9c378/all_tests.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11371, 13332, 327, 2836, 3813, 18, 4709, 13587, 12443, 3179, 67, 16341, 18, 3644, 67, 3813, 18, 30676, 9334, 3179, 67, 16341, 18, 892, 67, 3813, 18, 30676, 9334, 3179, 67, 16341, 18, 250...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 11371, 13332, 327, 2836, 3813, 18, 4709, 13587, 12443, 3179, 67, 16341, 18, 3644, 67, 3813, 18, 30676, 9334, 3179, 67, 16341, 18, 892, 67, 3813, 18, 30676, 9334, 3179, 67, 16341, 18, 250...
a = tcn.shared_constructor(numpy.random.rand(4,4), 'a')
a = tcn.shared_constructor(theano._asarray(numpy.random.rand(4,4), dtype='float32'), 'a')
def test_elemwise0(): a = tcn.shared_constructor(numpy.random.rand(4,4), 'a') b = tensor.fmatrix() f = pfunc([b], [], updates=[(a, a+b)], mode=mode_with_gpu) a0 = a.value * 1.0 print 'BEFORE ADD', a.value for i, node in enumerate(f.maker.env.toposort()): print i, node f(numpy.ones((4,4))) print 'AFTER ADD', a.value assert numpy.all(a0 + 1.0 == a.value)
8975b933b1f7fb5791fd7798b5420b449782a292 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/8975b933b1f7fb5791fd7798b5420b449782a292/test_basic_ops.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 10037, 2460, 20, 13332, 225, 279, 273, 1715, 82, 18, 11574, 67, 12316, 12, 5787, 31922, 6315, 345, 1126, 12, 15974, 18, 9188, 18, 7884, 12, 24, 16, 24, 3631, 3182, 2218, 5659...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 10037, 2460, 20, 13332, 225, 279, 273, 1715, 82, 18, 11574, 67, 12316, 12, 5787, 31922, 6315, 345, 1126, 12, 15974, 18, 9188, 18, 7884, 12, 24, 16, 24, 3631, 3182, 2218, 5659...
IntObject.methods['bool'] = PyFnMethod( lambda scope, obj : make_int(0) if obj.data==0 \ else make_int(1))
IntObject.methods['bool'] = PyFnMethod( lambda scope, obj : make_bool(obj.data) )
def int_lt( scope, obj, arg ): if not arg.inherits( IntObject ): raise RuntimeError, "Cannot compare int to non-int." return make_int( 1 if obj.data<arg.data else 0 )
c3eb52f34e4ae8a3d76b6dff2c5623c696aa6160 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10358/c3eb52f34e4ae8a3d76b6dff2c5623c696aa6160/yalie.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 509, 67, 5618, 12, 2146, 16, 1081, 16, 1501, 262, 30, 309, 486, 1501, 18, 267, 20038, 12, 3094, 921, 262, 30, 1002, 7265, 16, 315, 4515, 3400, 509, 358, 1661, 17, 474, 1199, 327, 122...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 509, 67, 5618, 12, 2146, 16, 1081, 16, 1501, 262, 30, 309, 486, 1501, 18, 267, 20038, 12, 3094, 921, 262, 30, 1002, 7265, 16, 315, 4515, 3400, 509, 358, 1661, 17, 474, 1199, 327, 122...
build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, status=Build.PENDING)
platform = TargetPlatform(self.env, config='test', name='Foo') platform.insert() build = Build(self.env, config='test', platform=platform.id, rev=123, rev_time=42, status=Build.PENDING)
def test_next_pending_build_inactive_config(self): """ Make sure that builds for a deactived build config are not scheduled. """ BuildConfig(self.env, 'test').insert() build = Build(self.env, config='test', platform=1, rev=123, rev_time=42, status=Build.PENDING) build.insert()
51168ca3df127068de896ee3682446d3b007ab41 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/4547/51168ca3df127068de896ee3682446d3b007ab41/queue.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4285, 67, 9561, 67, 3510, 67, 27366, 67, 1425, 12, 2890, 4672, 3536, 4344, 3071, 716, 10736, 364, 279, 443, 621, 2950, 1361, 642, 854, 486, 9755, 18, 3536, 3998, 809, 12, 289...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 4285, 67, 9561, 67, 3510, 67, 27366, 67, 1425, 12, 2890, 4672, 3536, 4344, 3071, 716, 10736, 364, 279, 443, 621, 2950, 1361, 642, 854, 486, 9755, 18, 3536, 3998, 809, 12, 289...
ai("def x():\n")
ai("def x():\n")
f3c21a8a80c1683e7d68fff33ba8c10f20ac6345 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/f3c21a8a80c1683e7d68fff33ba8c10f20ac6345/test_codeop.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 14679, 2932, 536, 619, 1435, 5581, 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, 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, 14679, 2932, 536, 619, 1435, 5581, 82, 7923, 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, -1...
target = target.encode('UTF-8')
pathname = _get_pathname(target, base) url = urllib.pathname2url(pathname.encode('UTF-8')) if os.path.isabs(pathname): pre = url.startswith('/') and 'file:' or 'file:///' url = pre + url return url.replace('%5C', '/').replace('%3A', ':').replace('|', ':') def _get_pathname(target, base):
def get_link_path(target, base): """Returns a relative path to a target from a base. If base is an existing file, then its parent directory is considered. Otherwise, base is assumed to be a directory. Rationale: os.path.relpath is not available before Python 2.6 """ target = target.encode('UTF-8') target = normpath(target) base = normpath(base) if os.path.isfile(base): base = os.path.dirname(base) if base == target: return urllib.pathname2url(os.path.basename(target)) base_drive, base_path = os.path.splitdrive(base) # if in Windows and base and link on different drives if os.path.splitdrive(target)[0] != base_drive: return 'file:' + urllib.pathname2url(target) common_len = len(_common_path(base, target)) if base_path == os.sep: return urllib.pathname2url(target[common_len:]) if common_len == len(base_drive) + len(os.sep): common_len -= len(os.sep) dirs_up = os.sep.join([os.pardir] * base[common_len:].count(os.sep)) return urllib.pathname2url(os.path.join(dirs_up, target[common_len + len(os.sep):]))
981e2a7fcffa2608e2b8ea9c5d06bf0165502bf4 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/6988/981e2a7fcffa2608e2b8ea9c5d06bf0165502bf4/misc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 1232, 67, 803, 12, 3299, 16, 1026, 4672, 3536, 1356, 279, 3632, 589, 358, 279, 1018, 628, 279, 1026, 18, 971, 1026, 353, 392, 2062, 585, 16, 1508, 2097, 982, 1867, 353, 7399, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1232, 67, 803, 12, 3299, 16, 1026, 4672, 3536, 1356, 279, 3632, 589, 358, 279, 1018, 628, 279, 1026, 18, 971, 1026, 353, 392, 2062, 585, 16, 1508, 2097, 982, 1867, 353, 7399, ...
self.desktop_entry.write()
try: self.desktop_entry.write() except IOError, e: err_dialog(_('Couldn\'t save the launcher. Error: %s') % e) self.main_dialog.hide_all() return
def err_dialog(msg): dialog = gtk.MessageDialog(self.main_dialog, gtk.DIALOG_MODAL, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, msg) dialog.set_property('use-markup', True) dialog.run() dialog.hide_all()
91af70ab0defe92228baad3399448ea46c7f9be6 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8416/91af70ab0defe92228baad3399448ea46c7f9be6/awnLauncherEditor.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 393, 67, 12730, 12, 3576, 4672, 6176, 273, 22718, 18, 1079, 6353, 12, 2890, 18, 5254, 67, 12730, 16, 22718, 18, 2565, 18683, 67, 6720, 1013, 16, 22718, 18, 8723, 67, 3589, 16, 22718, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 393, 67, 12730, 12, 3576, 4672, 6176, 273, 22718, 18, 1079, 6353, 12, 2890, 18, 5254, 67, 12730, 16, 22718, 18, 2565, 18683, 67, 6720, 1013, 16, 22718, 18, 8723, 67, 3589, 16, 22718, 1...
block2 += L[:len(L)-len(L.lstrip())] + M
lstrip = L.lstrip() if lstrip[:5] == 'sage:' or lstrip[:3] == '>>>': block2 += M else: block2 += L[:len(L)-len(lstrip)] + M
def sage_prefilter(self, block, continuation): """ SAGE's prefilter for input. Given a string block (usually a line), return the preparsed version of it. INPUT: block -- string (usually a single line, but not always) continuation -- whether or not this line is a continuation. """ try: block2 = '' for L in block.split('\n'): M = do_prefilter_paste(L, continuation) # The L[:len(L)-len(L.lstrip())] business here preserves # the whitespace at the beginning of L. if block2 != '': block2 += '\n' block2 += L[:len(L)-len(L.lstrip())] + M except None: print "WARNING: An error occured in the SAGE parser while" print "parsing the following block:" print block print "Please report this as a bug (include the output of typing '%hist')." block2 = block return InteractiveShell._prefilter(self, block2, continuation)
e1299616b309467d8ba312615cc9ec5de197e8ce /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/e1299616b309467d8ba312615cc9ec5de197e8ce/interpreter.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 410, 67, 1484, 2188, 12, 2890, 16, 1203, 16, 17378, 4672, 3536, 348, 2833, 1807, 675, 2188, 364, 810, 18, 225, 16803, 279, 533, 1203, 261, 407, 3452, 279, 980, 3631, 327, 326, 675...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 272, 410, 67, 1484, 2188, 12, 2890, 16, 1203, 16, 17378, 4672, 3536, 348, 2833, 1807, 675, 2188, 364, 810, 18, 225, 16803, 279, 533, 1203, 261, 407, 3452, 279, 980, 3631, 327, 326, 675...
"SELECT time, author, 'attachment', null, filename " "FROM attachment " "WHERE id=%s AND time=%s "
"SELECT time,author,'attachment',null,filename " "FROM attachment WHERE id=%s AND time=%s " "UNION " "SELECT time,author,'comment',null,description " "FROM attachment WHERE id=%s AND time=%s "
def get_changelog(self, db, when=0): """ Returns the changelog as a list of tuples of the form (time, author, field, oldvalue, newvalue). """ cursor = db.cursor() if when: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change " "WHERE ticket=%s AND time=%s " "UNION " "SELECT time, author, 'attachment', null, filename " "FROM attachment " "WHERE id=%s AND time=%s " "ORDER BY time", (self['id'], when, self['id'], when)) else: cursor.execute("SELECT time,author,field,oldvalue,newvalue " "FROM ticket_change WHERE ticket=%s " "UNION " "SELECT time, author, 'attachment', null,filename " "FROM attachment WHERE id = %s " "ORDER BY time", (self['id'], self['id'])) log = [] while 1: row = cursor.fetchone() if not row: break log.append((int(row[0]), row[1], row[2], row[3] or '', row[4] or '')) return log
f8a5132dbed742f2b79fc3631356a46a973d2ec8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2831/f8a5132dbed742f2b79fc3631356a46a973d2ec8/Ticket.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 24083, 12970, 12, 2890, 16, 1319, 16, 1347, 33, 20, 4672, 3536, 2860, 326, 21182, 487, 279, 666, 434, 10384, 434, 326, 646, 261, 957, 16, 2869, 16, 652, 16, 1592, 1132, 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, 336, 67, 24083, 12970, 12, 2890, 16, 1319, 16, 1347, 33, 20, 4672, 3536, 2860, 326, 21182, 487, 279, 666, 434, 10384, 434, 326, 646, 261, 957, 16, 2869, 16, 652, 16, 1592, 1132, 16, ...
im_total = 0 im_rescue = 0
im_total = set() im_rescue = set()
def getEntityStatus(self, location): session = create_session() q = session.query(Target).add_entity(Image).select_from(self.target \ .join(self.imaging_server, self.target.c.fk_entity == self.imaging_server.c.fk_entity) \ .join(self.entity, self.entity.c.id == self.target.c.fk_entity) \ .outerjoin(self.imaging_log, self.imaging_log.c.fk_target == self.target.c.id) \ .outerjoin(self.mastered_on, self.mastered_on.c.fk_imaging_log == self.imaging_log.c.id) \ .outerjoin(self.image, self.mastered_on.c.fk_image == self.image.c.id) \ ).filter(and_(self.entity.c.uuid == location, self.target.c.type.in_((P2IT.COMPUTER, P2IT.COMPUTER_IN_PROFILE)))) q = q.group_by().all() im_total = 0 im_rescue = 0 for t, i in q: im_total += 1 if i != None: im_rescue += 1
3a0dc855f43311660e015406b98eb8bf531282ae /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5988/3a0dc855f43311660e015406b98eb8bf531282ae/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6352, 1482, 12, 2890, 16, 2117, 4672, 1339, 273, 752, 67, 3184, 1435, 1043, 273, 1339, 18, 2271, 12, 2326, 2934, 1289, 67, 1096, 12, 2040, 2934, 4025, 67, 2080, 12, 2890, 18, 3299, 521...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6352, 1482, 12, 2890, 16, 2117, 4672, 1339, 273, 752, 67, 3184, 1435, 1043, 273, 1339, 18, 2271, 12, 2326, 2934, 1289, 67, 1096, 12, 2040, 2934, 4025, 67, 2080, 12, 2890, 18, 3299, 521...
print nff, nft, ntf, ntt
def yule(u, v): """ Computes the Yule dissimilarity between two boolean n-vectors u and v, which is defined as .. math: \frac{R} \frac{c_{TT} + c_{FF} + \frac{R}{2}} where :math:`$c_{ij}$` is the number of occurrences of :math:`$\mathtt{u[k]}` = i$ and :math:`$\mathtt{v[k]} = j$` for :math:`$k < n$` and :math:`$R = 2.0 * (c_{TF} + c_{FT})$`. :Parameters: u : ndarray An :math:`n`-dimensional vector. v : ndarray An :math:`n`-dimensional vector. :Returns: d : double The Yule dissimilarity between vectors ``u`` and ``v``. """ u = np.asarray(u) v = np.asarray(v) (nff, nft, ntf, ntt) = _nbool_correspond_all(u, v) print nff, nft, ntf, ntt return float(2.0 * ntf * nft) / float(ntt * nff + ntf * nft)
c0664ad91797cb75f88e4e0bb32df724814e0acf /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/12971/c0664ad91797cb75f88e4e0bb32df724814e0acf/distance.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 677, 725, 12, 89, 16, 331, 4672, 3536, 14169, 281, 326, 1624, 725, 1015, 22985, 560, 3086, 2795, 1250, 290, 17, 18535, 582, 471, 331, 16, 1492, 353, 2553, 487, 282, 6116, 4233, 30, 225...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 677, 725, 12, 89, 16, 331, 4672, 3536, 14169, 281, 326, 1624, 725, 1015, 22985, 560, 3086, 2795, 1250, 290, 17, 18535, 582, 471, 331, 16, 1492, 353, 2553, 487, 282, 6116, 4233, 30, 225...
def add_data_vdr(self, vdr_epg_file):
def add_data_vdr(self, epg_file=None, host=None, port=None):
def add_data_vdr(self, vdr_epg_file): try: import vdrpylib except: print 'vdrpylib not installed'
77d075e2a24e5a102d969590ee6fb2860253d80a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11399/77d075e2a24e5a102d969590ee6fb2860253d80a/guide.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 527, 67, 892, 67, 90, 3069, 12, 2890, 16, 31682, 67, 768, 33, 7036, 16, 1479, 33, 7036, 16, 1756, 33, 7036, 4672, 775, 30, 1930, 331, 3069, 2074, 2941, 1335, 30, 1172, 296, 90, 3069,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 527, 67, 892, 67, 90, 3069, 12, 2890, 16, 31682, 67, 768, 33, 7036, 16, 1479, 33, 7036, 16, 1756, 33, 7036, 4672, 775, 30, 1930, 331, 3069, 2074, 2941, 1335, 30, 1172, 296, 90, 3069,...
glyphLeft = left + ((-xP - xA -w) * scale) glyphWidth = (w + xA) * scale
glyphLeft = left + ((-xP - xA) * scale) glyphWidth = -xA * scale
def drawRectRightToLeft_(self, rect): self._alternateRects = {} # draw the background bounds = self.bounds() self._backgroundColor.set() NSRectFill(bounds) # create some reusable values scale = self._scale descender = self._descender upm = self._upm scaledBuffer = self._buffer * (1.0 / scale) scrollWidth = bounds.size[0] # offset for the buffer ctx = NSGraphicsContext.currentContext() ctx.saveGraphicsState() aT = NSAffineTransform.transform() aT.translateXBy_yBy_(scrollWidth - self._buffer, self._buffer) aT.concat() # offset for the descender aT = NSAffineTransform.transform() aT.scaleBy_(scale) aT.translateXBy_yBy_(0, descender) aT.concat() # flip flipTransform = NSAffineTransform.transform() flipTransform.translateXBy_yBy_(0, upm) flipTransform.scaleXBy_yBy_(1.0, -1.0) flipTransform.concat() # set the glyph color self._glyphColor.set() # draw the records left = scrollWidth - self._buffer bottom = self._buffer height = upm * scale for recordIndex, glyphRecord in enumerate(self._glyphRecords): glyph = glyphRecord.glyph w = glyph.width xP = glyphRecord.xPlacement yP = glyphRecord.yPlacement xA = glyphRecord.xAdvance yA = glyphRecord.yAdvance path = glyph.getRepresentation("defconAppKit.NSBezierPath") # handle offsets from the record bottom += yP glyphHeight = height + yA glyphLeft = left + ((-xP - xA -w) * scale) glyphWidth = (w + xA) * scale # store the glyph rect for the alternate menu rect = ((glyphLeft, bottom), (glyphWidth, glyphHeight)) self._alternateRects[rect] = recordIndex # fill the glyph rect if glyph glyph is .notdef if glyph.name == ".notdef": self._notdefBackgroundColor.set() rect = ((-w, descender), (w, upm)) NSRectFillUsingOperation(rect, NSCompositeSourceOver) self._glyphColor.set() # shift into place and draw the glyph aT = NSAffineTransform.transform() aT.translateXBy_yBy_(-xP - xA - w, yP) aT.concat() # fill the path, highlighting alternates # if necessary if glyphRecord.alternates: self._alternateHighlightColor.set() path.fill() self._glyphColor.set() else: path.fill() # remove the y placement that was applied # and shift horizontally for the next glyph aT = NSAffineTransform.transform() aT.translateXBy_yBy_(0, -yP) aT.concat() left += (-xP - xA - w) * scale ctx.restoreGraphicsState()
5a673ffbd30b8726db9034e60dcc25f5cfad6edf /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/8848/5a673ffbd30b8726db9034e60dcc25f5cfad6edf/glyphLineView.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 6120, 4726, 774, 3910, 67, 12, 2890, 16, 4917, 4672, 365, 6315, 16025, 340, 6120, 87, 273, 2618, 468, 3724, 326, 5412, 4972, 273, 365, 18, 10576, 1435, 365, 6315, 9342, 2957, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3724, 6120, 4726, 774, 3910, 67, 12, 2890, 16, 4917, 4672, 365, 6315, 16025, 340, 6120, 87, 273, 2618, 468, 3724, 326, 5412, 4972, 273, 365, 18, 10576, 1435, 365, 6315, 9342, 2957, 18, ...
self.run('reboot')
self.run('(sleep 5; reboot) >/dev/null 2>&1 &')
def reboot(self, timeout=DEFAULT_REBOOT_TIMEOUT, label=None, kernel_args=None, wait=True): """ Reboot the remote host. Args: timeout """ # forcibly include the "netconsole" kernel arg if self.__netconsole_param: if kernel_args is None: kernel_args = self.__netconsole_param else: kernel_args += " " + self.__netconsole_param # unload the (possibly loaded) module to avoid shutdown issues self.__unload_netconsole_module() if label or kernel_args: self.bootloader.install_boottool() if label: self.bootloader.set_default(label) if kernel_args: if not label: default = int(self.bootloader.get_default()) label = self.bootloader.get_titles()[default] self.bootloader.add_args(label, kernel_args) print "Reboot: initiating reboot" sys.stderr.write("REBOOT\n") self.run('reboot') if wait: self._wait_for_restart(timeout) self.__load_netconsole_module() # if the builtin fails
cecc0e85e59cc156369b75715cdf1555015156ac /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/12268/cecc0e85e59cc156369b75715cdf1555015156ac/ssh_host.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22852, 12, 2890, 16, 2021, 33, 5280, 67, 862, 30124, 67, 9503, 16, 1433, 33, 7036, 16, 5536, 67, 1968, 33, 7036, 16, 2529, 33, 5510, 4672, 3536, 31405, 326, 2632, 1479, 18, 225, 6634, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 22852, 12, 2890, 16, 2021, 33, 5280, 67, 862, 30124, 67, 9503, 16, 1433, 33, 7036, 16, 5536, 67, 1968, 33, 7036, 16, 2529, 33, 5510, 4672, 3536, 31405, 326, 2632, 1479, 18, 225, 6634, ...
out = os.fdopen(os.open(dest, os.O_CREAT | os.O_WRONLY), 'w')
out = file(dest, 'w')
def _do_deploy(self, dest): target = os.path.normpath(dest) chrome_target = os.path.join(target, 'htdocs') script_target = os.path.join(target, 'cgi-bin')
74235e80ffa66e5cc5ed726433fdcc6bc48dcec1 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/2831/74235e80ffa66e5cc5ed726433fdcc6bc48dcec1/env.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2896, 67, 12411, 12, 2890, 16, 1570, 4672, 1018, 273, 1140, 18, 803, 18, 7959, 803, 12, 10488, 13, 18167, 67, 3299, 273, 1140, 18, 803, 18, 5701, 12, 3299, 16, 296, 647, 8532, 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2896, 67, 12411, 12, 2890, 16, 1570, 4672, 1018, 273, 1140, 18, 803, 18, 7959, 803, 12, 10488, 13, 18167, 67, 3299, 273, 1140, 18, 803, 18, 5701, 12, 3299, 16, 296, 647, 8532, 6...
total_time = time.time() - start_time if total_time > 1.0: print "Presubmit checks took %.1fs to calculate." % total_time
def DoPresubmitChecks(change, committing, verbose, output_stream, input_stream, default_presubmit, may_prompt): """Runs all presubmit checks that apply to the files in the change. This finds all PRESUBMIT.py files in directories enclosing the files in the change (up to the repository root) and calls the relevant entrypoint function depending on whether the change is being committed or uploaded. Prints errors, warnings and notifications. Prompts the user for warnings when needed. Args: change: The Change object. committing: True if 'gcl commit' is running, False if 'gcl upload' is. verbose: Prints debug info. output_stream: A stream to write output from presubmit tests to. input_stream: A stream to read input from the user. default_presubmit: A default presubmit script to execute in any case. may_prompt: Enable (y/n) questions on warning or error. Warning: If may_prompt is true, output_stream SHOULD be sys.stdout and input_stream SHOULD be sys.stdin. Return: True if execution can continue, False if not. """ start_time = time.time() presubmit_files = ListRelevantPresubmitFiles(change.AbsoluteLocalPaths(True), change.RepositoryRoot()) if not presubmit_files and verbose: output_stream.write("Warning, no presubmit.py found.\n") results = [] executer = PresubmitExecuter(change, committing) if default_presubmit: if verbose: output_stream.write("Running default presubmit script.\n") fake_path = os.path.join(change.RepositoryRoot(), 'PRESUBMIT.py') results += executer.ExecPresubmitScript(default_presubmit, fake_path) for filename in presubmit_files: filename = os.path.abspath(filename) if verbose: output_stream.write("Running %s\n" % filename) # Accept CRLF presubmit script. presubmit_script = gcl.ReadFile(filename, 'rU') results += executer.ExecPresubmitScript(presubmit_script, filename) errors = [] notifications = [] warnings = [] for result in results: if not result.IsFatal() and not result.ShouldPrompt(): notifications.append(result) elif result.ShouldPrompt(): warnings.append(result) else: errors.append(result) error_count = 0 for name, items in (('Messages', notifications), ('Warnings', warnings), ('ERRORS', errors)): if items: output_stream.write('** Presubmit %s **\n' % name) for item in items: if not item._Handle(output_stream, input_stream, may_prompt=False): error_count += 1 output_stream.write('\n') if not errors and warnings and may_prompt: output_stream.write( 'There were presubmit warnings. Sure you want to continue? (y/N): ') response = input_stream.readline() if response.strip().lower() != 'y': error_count += 1 total_time = time.time() - start_time if total_time > 1.0: print "Presubmit checks took %.1fs to calculate." % total_time global _ASKED_FOR_FEEDBACK # Ask for feedback one time out of 5. if (len(results) and random.randint(0, 4) == 0 and not _ASKED_FOR_FEEDBACK): output_stream.write("Was the presubmit check useful? Please send feedback " "& hate mail to maruel@chromium.org!\n") _ASKED_FOR_FEEDBACK = True return (error_count == 0)
88477b72a3fe8fc487aacc0b390c20accd5abd83 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/6076/88477b72a3fe8fc487aacc0b390c20accd5abd83/presubmit_support.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2256, 12236, 373, 1938, 4081, 12, 3427, 16, 3294, 1787, 16, 3988, 16, 876, 67, 3256, 16, 810, 67, 3256, 16, 805, 67, 12202, 373, 1938, 16, 2026, 67, 13325, 4672, 3536, 9361, 777, 4075,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2256, 12236, 373, 1938, 4081, 12, 3427, 16, 3294, 1787, 16, 3988, 16, 876, 67, 3256, 16, 810, 67, 3256, 16, 805, 67, 12202, 373, 1938, 16, 2026, 67, 13325, 4672, 3536, 9361, 777, 4075,...
try: body = [output, extra] except NameError: body = [output]
body = [output]
def perform_modifylogindata(req, userID, email='', password='', callback='yes', confirm=0): """modify email and password of an account""" (auth_code, auth_message) = is_adminuser(req) if auth_code != 0: return mustloginpage(req, auth_message) subtitle = """<a name="1"></a>1. Edit login-data.&nbsp&nbsp&nbsp<small>[<a title="See guide" href="%s/admin/webaccess/guide.html#4">?</a>]</small>""" % weburl res = run_sql("SELECT id, email, password FROM user WHERE id=%s" % userID) output = "" if res: if not email and not password: email = res[0][1] password = res[0][2] text = ' <span class="adminlabel">Account id:</span>%s<br>\n' % userID text += ' <span class="adminlabel">Email:</span>\n' text += ' <input class="admin_wvar" type="text" name="email" value="%s" /><br>' % (email, ) text += ' <span class="adminlabel">Password:</span>\n' text += ' <input class="admin_wvar" type="text" name="password" value="%s" /><br>' % (password, ) output += createhiddenform(action="modifylogindata", text=text, userID=userID, confirm=1, button="Modify") if confirm in [1, "1"] and email and email_valid_p(email): res = run_sql("UPDATE user SET email='%s' WHERE id=%s" % (escape_string(email), userID)) res = run_sql("UPDATE user SET password='%s' WHERE id=%s" % (escape_string(password), userID)) output += '<b><span class="info">Email and/or password modified.</span></b>' elif confirm in [1, "1"]: output += '<b><span class="info">Please specify an valid email-address.</span></b>' else: output += '<b><span class="info">The account id given does not exist.</span></b>' try: body = [output, extra] except NameError: body = [output] if callback: return perform_editaccount(req, userID, mtype='perform_modifylogindata', content=addadminbox(subtitle, body), callback='yes') else: return addadminbox(subtitle, body)
8e6aa1042563d2e1f44b1ffbe6e50d6cd67dbacc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1931/8e6aa1042563d2e1f44b1ffbe6e50d6cd67dbacc/webaccessadmin_lib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 17042, 1330, 728, 396, 12, 3658, 16, 16299, 16, 2699, 2218, 2187, 2201, 2218, 2187, 1348, 2218, 9707, 2187, 6932, 33, 20, 4672, 3536, 17042, 2699, 471, 2201, 434, 392, 2236, 83...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3073, 67, 17042, 1330, 728, 396, 12, 3658, 16, 16299, 16, 2699, 2218, 2187, 2201, 2218, 2187, 1348, 2218, 9707, 2187, 6932, 33, 20, 4672, 3536, 17042, 2699, 471, 2201, 434, 392, 2236, 83...
self.ratings.append((self._category, self._data))
self.ratings[self._category] = self._data
def end_data (self, name): super(RatingRule, self).end_data(name) if name == 'category': assert self._category self.ratings.append((self._category, self._data)) pass elif name == 'url': self.url = self._data
74071104b3b4ec9e2f6f86e5670b15b0cd8256aa /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3948/74071104b3b4ec9e2f6f86e5670b15b0cd8256aa/RatingRule.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 679, 67, 892, 261, 2890, 16, 508, 4672, 2240, 12, 20388, 2175, 16, 365, 2934, 409, 67, 892, 12, 529, 13, 309, 508, 422, 296, 4743, 4278, 1815, 365, 6315, 4743, 365, 18, 17048, 899, 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, 679, 67, 892, 261, 2890, 16, 508, 4672, 2240, 12, 20388, 2175, 16, 365, 2934, 409, 67, 892, 12, 529, 13, 309, 508, 422, 296, 4743, 4278, 1815, 365, 6315, 4743, 365, 18, 17048, 899, 6...
sorted_edges_iterator=iter(sorted(self.edges(), cmp=cmp))
sorted_edges_iterator=iter(sorted(self.edges(), key=weight_function))
def min_spanning_tree(self, weight_function=lambda e: 1, algorithm='Kruskal', starting_vertex=None ): """ Returns the edges of a minimum spanning tree, if one exists, otherwise returns False.
9fdade6e05f40caa98eeb767b6710606f1324d4e /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/9fdade6e05f40caa98eeb767b6710606f1324d4e/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1131, 67, 1752, 10903, 67, 3413, 12, 2890, 16, 3119, 67, 915, 33, 14661, 425, 30, 404, 16, 4886, 2218, 47, 8010, 79, 287, 2187, 5023, 67, 15281, 33, 7036, 262, 30, 3536, 2860, 326, 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, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1131, 67, 1752, 10903, 67, 3413, 12, 2890, 16, 3119, 67, 915, 33, 14661, 425, 30, 404, 16, 4886, 2218, 47, 8010, 79, 287, 2187, 5023, 67, 15281, 33, 7036, 262, 30, 3536, 2860, 326, 5...
2.00000000000000 \times 10^{-13}
2 \times 10^{-13}
def float_function(x): r""" Returns the LaTeX code for a python float ``x``. INPUT: ``x`` - a python float EXAMPLES:: sage: from sage.misc.latex import float_function sage: float_function(float(3.14)) 3.14 sage: float_function(float(1e-10)) 1 \times 10^{-10} sage: float_function(float(2e10)) 20000000000.0 sage: latex(float(2e-13)) 2.00000000000000 \times 10^{-13} """ from sage.all import RDF return latex(RDF(x))
047dbdca88ebd761c66859865e8a25bb656a2407 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9890/047dbdca88ebd761c66859865e8a25bb656a2407/latex.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1431, 67, 915, 12, 92, 4672, 436, 8395, 2860, 326, 21072, 21575, 60, 981, 364, 279, 5790, 1431, 12176, 92, 68, 8338, 225, 12943, 30, 12176, 92, 10335, 300, 279, 5790, 1431, 225, 5675, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1431, 67, 915, 12, 92, 4672, 436, 8395, 2860, 326, 21072, 21575, 60, 981, 364, 279, 5790, 1431, 12176, 92, 68, 8338, 225, 12943, 30, 12176, 92, 10335, 300, 279, 5790, 1431, 225, 5675, ...
self.blacklist_for_save = set(["publisher_warranty_url"])
self.blacklist_for_save = set(["publisher_warranty_url", "load_language"])
def __init__(self, fname=None): self.options = { 'email_from':False, 'xmlrpc_interface': '', # this will bind the server to all interfaces 'xmlrpc_port': 8069, 'netrpc_interface': '', 'netrpc_port': 8070, 'xmlrpcs_interface': '', # this will bind the server to all interfaces 'xmlrpcs_port': 8071, 'db_host': False, 'db_port': False, 'db_name': False, 'db_user': False, 'db_password': False, 'db_maxconn': 64, 'reportgz': False, 'netrpc': True, 'xmlrpc': True, 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, 'overwrite_existing_translations': False, 'load_language': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', 'csv_internal_sep': ',', 'addons_path': None, 'root_path': None, 'debug_mode': False, 'import_partial': "", 'pidfile': None, 'logfile': None, 'logrotate': True, 'smtp_server': 'localhost', 'smtp_user': False, 'smtp_port':25, 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised 'cache_timeout': 100000, 'login_message': False, 'list_db' : True, 'timezone' : False, # to override the default TZ 'test_file' : False, 'test_report_directory' : False, 'test_disable' : False, 'test_commit' : False, 'static_http_enable': False, 'static_http_document_root': None, 'static_http_url_prefix': None, 'secure_cert_file': 'server.cert', 'secure_pkey_file': 'server.pkey', 'publisher_warranty_url': 'http://services.openerp.com/publisher-warranty/', } self.blacklist_for_save = set(["publisher_warranty_url"])
7da94abb11ea2178baee3a2c05fdf81285809255 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12853/7da94abb11ea2178baee3a2c05fdf81285809255/config.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 5299, 33, 7036, 4672, 365, 18, 2116, 273, 288, 296, 3652, 67, 2080, 4278, 8381, 16, 296, 2902, 7452, 67, 5831, 4278, 10226, 565, 468, 333, 903, 1993, 326...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 5299, 33, 7036, 4672, 365, 18, 2116, 273, 288, 296, 3652, 67, 2080, 4278, 8381, 16, 296, 2902, 7452, 67, 5831, 4278, 10226, 565, 468, 333, 903, 1993, 326...
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
def WriteGLES2ImplementationImpl(self, func, file): """Overrriden from TypeHandler.""" pass
b4a937e280d5e05e48c8a7abf6caf1fdf5448b1b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/b4a937e280d5e05e48c8a7abf6caf1fdf5448b1b/build_gles2_cmd_buffer.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 43, 11386, 22, 13621, 2828, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 1342, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 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, 2598, 43, 11386, 22, 13621, 2828, 12, 2890, 16, 1326, 16, 585, 4672, 3536, 22042, 1691, 275, 628, 1412, 1503, 12123, 1342, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
return self.translated_name[langcode] return self.name
return to_unicode(self.translated_name[langcode]) return to_unicode(self.name)
def nameByLang(self, lang):
68d27bd254094d3a08dd6195358aabd4c7537901 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/5445/68d27bd254094d3a08dd6195358aabd4c7537901/comps.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 508, 858, 7275, 12, 2890, 16, 3303, 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, ...
[ 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 508, 858, 7275, 12, 2890, 16, 3303, 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,...
parts = [tagname.lower()]
parts = [tagname]
def starttag(self, node, tagname, suffix='\n', infix='', **attributes): """ Construct and return a start tag given a node (id & class attributes are extracted), tag name, and optional attributes. """ atts = {} for (name, value) in attributes.items(): atts[name.lower()] = value for att in ('class',): # append to node attribute if node.has_key(att) or atts.has_key(att): atts[att] = \ (node.get(att, '') + ' ' + atts.get(att, '')).strip() for att in ('id',): # node attribute overrides if node.has_key(att): atts[att] = node[att] if atts.has_key('id'): atts['name'] = atts['id'] # for compatibility with old browsers attlist = atts.items() attlist.sort() parts = [tagname.lower()] for name, value in attlist: if value is None: # boolean attribute # According to the HTML spec, ``<element boolean>`` is good, # ``<element boolean="boolean">`` is bad. # (But the XHTML (XML) spec says the opposite. <sigh>) parts.append(name.lower()) elif isinstance(value, ListType): values = [str(v) for v in value] parts.append('%s="%s"' % (name.lower(), self.attval(' '.join(values)))) else: parts.append('%s="%s"' % (name.lower(), self.attval(str(value)))) return '<%s%s>%s' % (' '.join(parts), infix, suffix)
73a64a073f51dc63c280c17071489b857b15d0fb /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1532/73a64a073f51dc63c280c17071489b857b15d0fb/html4css1.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 2692, 12, 2890, 16, 756, 16, 25586, 16, 3758, 2218, 64, 82, 2187, 316, 904, 2218, 2187, 2826, 4350, 4672, 3536, 14291, 471, 327, 279, 787, 1047, 864, 279, 756, 261, 350, 473, 667,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 787, 2692, 12, 2890, 16, 756, 16, 25586, 16, 3758, 2218, 64, 82, 2187, 316, 904, 2218, 2187, 2826, 4350, 4672, 3536, 14291, 471, 327, 279, 787, 1047, 864, 279, 756, 261, 350, 473, 667,...
if a==0:
if a == 0:
def _add_(self, right): """ EXAMPLES: sage: K = Qp(11, 10); K.print_prec(5) sage: a = K(-1); a 10 + 10*11 + 10*11^2 + 10*11^3 + 10*11^4 + O(11^10) sage: b = K(1); b 1 sage: a+b 0 """ if self.__ordp <= right.__ordp: x = self; y = right else: x = right; y = self big_oh = min(x.big_oh(), y.big_oh()) if y == 0: return pAdic(self.__parent, x, big_oh) p = x.__p a = x.__unit + p**(y.__ordp - x.__ordp)*y.__unit n = arith.valuation(a,p) if n == infinity: # 0 return pAdic(self.__parent, 0, big_oh) a /= p**n prec = big_oh - n - x.__ordp if prec != infinity: a %= p**prec if a==0: return pAdic(self.__parent, 0, big_oh) return pAdic(self.__parent, a, big_oh ,x.__ordp + n)
b03c9fbbcea7e9ad559130d155395a2c8cee8050 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/9890/b03c9fbbcea7e9ad559130d155395a2c8cee8050/padic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1289, 67, 12, 2890, 16, 2145, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 1475, 273, 2238, 84, 12, 2499, 16, 1728, 1769, 1475, 18, 1188, 67, 4036, 12, 25, 13, 272, 410, 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, 389, 1289, 67, 12, 2890, 16, 2145, 4672, 3536, 5675, 8900, 11386, 30, 272, 410, 30, 1475, 273, 2238, 84, 12, 2499, 16, 1728, 1769, 1475, 18, 1188, 67, 4036, 12, 25, 13, 272, 410, 30,...
tmp_keys = keys.copy()
tmp_keys = copy.deepcopy(keys)
def check_keybinding_conflicts(keys): """ check for conflicting keybindings. we have to check twice, because keys for setting picks and magnitudes are allowed to interfere... """ for ignored_key_list in [['setMagMin', 'setMagMax', 'delMagMinMax'], ['setPick', 'setPickError', 'delPick']]: tmp_keys = keys.copy() tmp_keys2 = {} for ignored_key in ignored_key_list: tmp_keys.pop(ignored_key) while tmp_keys: key, item = tmp_keys.popitem() if isinstance(item, dict): while item: k, v = item.popitem() tmp_keys2["_".join([key, str(v)])] = k else: tmp_keys2[key] = item if len(set(tmp_keys2.keys())) != len(set(tmp_keys2.values())): err = "Interfering keybindings. Please check variable KEYS" raise Exception(err)
2c1327481790c538265f81ea04dd0d01b722fbfc /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10346/2c1327481790c538265f81ea04dd0d01b722fbfc/obspyck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 856, 7374, 67, 20340, 87, 12, 2452, 4672, 3536, 866, 364, 21462, 498, 15863, 18, 732, 1240, 358, 866, 13605, 16, 2724, 1311, 364, 3637, 6002, 87, 471, 28160, 24751, 854, 2935, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 67, 856, 7374, 67, 20340, 87, 12, 2452, 4672, 3536, 866, 364, 21462, 498, 15863, 18, 732, 1240, 358, 866, 13605, 16, 2724, 1311, 364, 3637, 6002, 87, 471, 28160, 24751, 854, 2935, ...
else
else:
def _publish_test_log_files_ ( unused, dir, names ): for file in names: if os.path.basename( file ) == 'test_log.xml': utils.log( 'Publishing test log "%s"' % os.path.join(dir,file) ) if dart_server: log_xml = open(os.path.join(dir,file)).read().translate(ascii_only_table) #~ utils.log( '--- XML:\n%s' % log_xml) log_dom = xml.dom.minidom.parseString(log_xml) test = { 'library': log_dom.documentElement.getAttribute('library'), 'test-name': log_dom.documentElement.getAttribute('test-name'), 'toolset': log_dom.documentElement.getAttribute('toolset') } if not test['test-name'] or test['test-name'] == '': test['test-name'] = 'unknown' if not test['toolset'] or test['toolset'] == '': test['toolset'] = 'unknown' if not dart_dom.has_key(test['toolset']): dart_dom[test['toolset']] = xml.dom.minidom.parseString(
f4deaa0b59dae5e4090dd416bab82f6ad9e16890 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7959/f4deaa0b59dae5e4090dd416bab82f6ad9e16890/collect_and_upload_logs.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6543, 67, 3813, 67, 1330, 67, 2354, 67, 261, 10197, 16, 1577, 16, 1257, 262, 30, 364, 585, 316, 1257, 30, 309, 1140, 18, 803, 18, 13909, 12, 585, 262, 422, 296, 3813, 67, 1330, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 6543, 67, 3813, 67, 1330, 67, 2354, 67, 261, 10197, 16, 1577, 16, 1257, 262, 30, 364, 585, 316, 1257, 30, 309, 1140, 18, 803, 18, 13909, 12, 585, 262, 422, 296, 3813, 67, 1330, ...
class T_local_sum_canonicalize(unittest.TestCase):
class T_local_sum(unittest.TestCase):
def test_constant_get_stabilized(): """ Currently Theano enable the constant_folding optimization before stabilization optimization. This cause some stabilization optimization not being implemented and thus cause inf value to appear when it should not. .. note: we can't simply move the constant_folding optimization to specialize as this break other optimization! We will need to partially duplicate some canonicalize optimzation to specialize to fix this issue. """ x2 = T.scalar() y2 = T.log(1+T.exp(x2)) f2 = theano.function([x2],y2) assert len(f2.maker.env.toposort())==1 assert f2.maker.env.toposort()[0].op==theano.tensor.nnet.sigm.softplus assert f2(800)==800 x = T.as_tensor_variable(800) y = T.log(1+T.exp(x)) f = theano.function([],y) assert len(f.maker.env.toposort())==0 assert numpy.isinf(f()) raise KnownFailureTest("Theano optimize constant before stabilization! This break stabilization optimization is some case!") #When this error is fixed, the following line should be ok. assert f()==800,f()
60f4eb558d15e778691a242263c792b36310dee0 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12438/60f4eb558d15e778691a242263c792b36310dee0/test_opt.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 14384, 67, 588, 67, 334, 22681, 1235, 13332, 3536, 15212, 1021, 31922, 4237, 326, 5381, 67, 16007, 310, 14850, 1865, 384, 22681, 1588, 14850, 18, 1220, 4620, 2690, 384, 22681, 15...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 14384, 67, 588, 67, 334, 22681, 1235, 13332, 3536, 15212, 1021, 31922, 4237, 326, 5381, 67, 16007, 310, 14850, 1865, 384, 22681, 1588, 14850, 18, 1220, 4620, 2690, 384, 22681, 15...
@bigmemtest(minsize=_2G + 10, memuse=8)
@bigmemtest(minsize=_2G // 5 + 2, memuse=8 * 5)
def test_extend_large(self, size): return self.basic_test_extend(size)
636d1adc496d164c344c7505fdccb652d190f169 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/636d1adc496d164c344c7505fdccb652d190f169/test_bigmem.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 14313, 67, 14095, 12, 2890, 16, 963, 4672, 327, 365, 18, 13240, 67, 3813, 67, 14313, 12, 1467, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 14313, 67, 14095, 12, 2890, 16, 963, 4672, 327, 365, 18, 13240, 67, 3813, 67, 14313, 12, 1467, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
Returns the Cartan Type.
Returns the Cartan type.
def cartan_type(self): """ Returns the Cartan Type.
40a1bdf0c8a0dea7ba5d2dd2b4dcc1a210f7c884 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/9417/40a1bdf0c8a0dea7ba5d2dd2b4dcc1a210f7c884/weyl_characters.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7035, 304, 67, 723, 12, 2890, 4672, 3536, 2860, 326, 17695, 304, 1412, 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, ...
[ 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, 7035, 304, 67, 723, 12, 2890, 4672, 3536, 2860, 326, 17695, 304, 1412, 18, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, ...
@param id: structure type ID
@param sid: structure type ID
def DelStrucMember(id, member_offset): """ Delete structure member @param id: structure type ID @param member_offset: offset of the member @return: != 0 - ok. @note: IDA allows 'holes' between members of a structure. It treats these 'holes' as unnamed arrays of bytes. """ s = idaapi.get_struc(id) if not s: return 0 return idaapi.del_struc_member(s, member_offset)
76aa24fecdace41c9fc827e500b95cfdf5053272 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/4773/76aa24fecdace41c9fc827e500b95cfdf5053272/idc.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6603, 1585, 5286, 4419, 12, 350, 16, 3140, 67, 3348, 4672, 3536, 2504, 3695, 3140, 225, 632, 891, 7348, 30, 3695, 618, 1599, 632, 891, 3140, 67, 3348, 30, 1384, 434, 326, 3140, 225, 63...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6603, 1585, 5286, 4419, 12, 350, 16, 3140, 67, 3348, 4672, 3536, 2504, 3695, 3140, 225, 632, 891, 7348, 30, 3695, 618, 1599, 632, 891, 3140, 67, 3348, 30, 1384, 434, 326, 3140, 225, 63...
""" Return True if the LIGOTimeGPS is nonzero. Example use: bool(LIGOTimeGPS(100.5)) """
""" Return True if the LIGOTimeGPS is nonzero. Example use: bool(LIGOTimeGPS(100.5)) """
def __nonzero__(self):
b064bbbb4a6f3f9453fbf35a7c03643a8a94bd52 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/5758/b064bbbb4a6f3f9453fbf35a7c03643a8a94bd52/lal.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 26449, 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, 26449, 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, -...
try: del self.c1 except AttributeError: pass else: del self.c2, self.center, self.a1pos, self.a2pos, self.toolong
self._valid_data = None
def setup_invalidate(self): """Semi-private method for bonds. Invalidates cached geometric values related to drawing the bond. This must be called whenever the position or element of either bonded atom is changed, or when either atom's molecule changes if this affects whether it's an external bond (since the coordinate system used for drawing is different in each case). (FYI: It need not be called for other changes that might affect bond appearance, like disp or color of bonded molecules, though for internal bonds, the molecule's .havelist should be reset when those things change.) (It's not yet clear whether this needs to be called when bond-valence is changed. If it does, that will be done from one place, the changed_valence() method. [bruce 050502]) Note that before the "inval/update" revisions [bruce 041104], self.setup() (the old name for this method, from point of view of callers) did the recomputation now done on demand by __setup_update; now this method only does the invalidation which makes sure that recomputation will happen when it's needed. """ # just delete all the attrs recomputed by self.__setup_update() try: del self.c1 except AttributeError: pass # assume other attrs are also not there else: # assume other attrs are also there del self.c2, self.center, self.a1pos, self.a2pos, self.toolong # For internal bonds, or bonds that used to be internal, # callers need to have reset havelist of affected mols, # but the changes in atoms that required them to call setup_invalidate # mean they should have done that anyway (except for bond making and # breaking, in this file, which does this in invalidate_bonded_mols). # Bruce 041207 scanned all callers and concluded they do this as needed, # so I'm removing the explicit resets of havelist here, which were often # more than needed since they hit both mols of external bonds. # This change might speed up some redraws, esp. in move or deposit modes. return
8458fbfe4c9e599a4e7092a28b468082d5fe6e91 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/8458fbfe4c9e599a4e7092a28b468082d5fe6e91/bonds.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 5387, 340, 12, 2890, 4672, 3536, 13185, 77, 17, 1152, 707, 364, 15692, 18, 1962, 815, 3472, 7364, 1591, 924, 3746, 358, 16327, 326, 8427, 18, 1220, 1297, 506, 2566, 17334, 326,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3875, 67, 5387, 340, 12, 2890, 4672, 3536, 13185, 77, 17, 1152, 707, 364, 15692, 18, 1962, 815, 3472, 7364, 1591, 924, 3746, 358, 16327, 326, 8427, 18, 1220, 1297, 506, 2566, 17334, 326,...
This equation can be solved within Maxima but not within Sage. It needs assumptions assume(x>0,y>0) and works in Maxima, but not in Sage:: sage: assume(x>0) sage: assume(y>0) sage: desolve(x*diff(y,x)-x*sqrt(y^2+x^2)-y,y,show_method=True)
def desolve(de, dvar, ics=None, ivar=None, show_method=False, contrib_ode=False): r""" Solves a 1st or 2nd order linear ODE via maxima. Including IVP and BVP. *Use* ``desolve? <tab>`` *if the output in truncated in notebook.* INPUT: - ``de`` - an expression or equation representing the ODE - ``dvar`` - the dependent variable (hereafter called ``y``) - ``ics`` - (optional) the initial or boundary conditions - for a first-order equation, specify the initial ``x`` and ``y`` - for a second-order equation, specify the initial ``x``, ``y``, and ``dy/dx``, i.e. write `[x_0, y(x_0), y'(x_0)]` - for a second-order boundary solution, specify initial and final ``x`` and ``y`` boundary conditions, i.e. write `[x_0, y(x_0), x_1, y(x_1)]`. - gives an error if the solution is not SymbolicEquation (as happens for example for Clairaut equation) - ``ivar`` - (optional) the independent variable (hereafter called x), which must be specified if there is more than one independent variable in the equation. - ``show_method`` - (optional) if true, then Sage returns pair ``[solution, method]``, where method is the string describing method which has been used to get solution (Maxima uses the following order for first order equations: linear, separable, exact (including exact with integrating factor), homogeneous, bernoulli, generalized homogeneous) - use carefully in class, see below for the example of the equation which is separable but this property is not recognized by Maxima and equation is solved as exact. - ``contrib_ode`` - (optional) if true, desolve allows to solve clairaut, lagrange, riccati and some other equations. May take a long time and thus turned off by default. Initial conditions can be used only if the result is one SymbolicEquation (does not contain singular solution, for example) OUTPUT: In most cases returns SymbolicEquation which defines the solution implicitly. If the result is in the form y(x)=... (happens for linear eqs.), returns the right-hand side only. The possible constant solutions of separable ODE's are omitted. EXAMPLES:: sage: x = var('x') sage: y = function('y', x) sage: desolve(diff(y,x) + y - 1, y) (c + e^x)*e^(-x) :: sage: f = desolve(diff(y,x) + y - 1, y, ics=[10,2]); f (e^10 + e^x)*e^(-x) :: sage: plot(f) We can also solve second-order differential equations.:: sage: x = var('x') sage: y = function('y', x) sage: de = diff(y,x,2) - y == x sage: desolve(de, y) k1*e^x + k2*e^(-x) - x :: sage: f = desolve(de, y, [10,2,1]); f -x + 5*e^(-x + 10) + 7*e^(x - 10) :: sage: f(x=10) 2 :: sage: diff(f,x)(x=10) 1 :: sage: de = diff(y,x,2) + y == 0 sage: desolve(de, y) k1*sin(x) + k2*cos(x) :: sage: desolve(de, y, [0,1,pi/2,4]) 4*sin(x) + cos(x) :: sage: desolve(y*diff(y,x)+sin(x)==0,y) -1/2*y(x)^2 == c - cos(x) Clairot equation: general and singular solutions:: sage: desolve(diff(y,x)^2+x*diff(y,x)-y==0,y,contrib_ode=True,show_method=True) [[y(x) == c^2 + c*x, y(x) == -1/4*x^2], 'clairault'] For equations involving more variables we specify independent variable:: sage: a,b,c,n=var('a b c n') sage: desolve(x^2*diff(y,x)==a+b*x^n+c*x^2*y^2,y,ivar=x,contrib_ode=True) [[y(x) == 0, (b*x^(n - 2) + a/x^2)*c^2*u == 0]] :: sage: desolve(x^2*diff(y,x)==a+b*x^n+c*x^2*y^2,y,ivar=x,contrib_ode=True,show_method=True) [[[y(x) == 0, (b*x^(n - 2) + a/x^2)*c^2*u == 0]], 'riccati'] Higher orded, not involving independent variable:: sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y).expand() 1/6*y(x)^3 + k1*y(x) == k2 + x :: sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y,[0,1,1,3]).expand() 1/6*y(x)^3 - 5/3*y(x) == x - 3/2 :: sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y,[0,1,1,3],show_method=True) [1/6*y(x)^3 - 5/3*y(x) == x - 3/2, 'freeofx'] Separable equations - Sage returns solution in implicit form:: sage: desolve(diff(y,x)*sin(y) == cos(x),y) -cos(y(x)) == c + sin(x) :: sage: desolve(diff(y,x)*sin(y) == cos(x),y,show_method=True) [-cos(y(x)) == c + sin(x), 'separable'] :: sage: desolve(diff(y,x)*sin(y) == cos(x),y,[pi/2,1]) -cos(y(x)) == sin(x) - cos(1) - 1 Linear equation - Sage returns the expression on the right hand side only:: sage: desolve(diff(y,x)+(y) == cos(x),y) 1/2*((sin(x) + cos(x))*e^x + 2*c)*e^(-x) :: sage: desolve(diff(y,x)+(y) == cos(x),y,show_method=True) [1/2*((sin(x) + cos(x))*e^x + 2*c)*e^(-x), 'linear'] :: sage: desolve(diff(y,x)+(y) == cos(x),y,[0,1]) 1/2*(e^x*sin(x) + e^x*cos(x) + 1)*e^(-x) This ODE with separated variables is solved as exact. Explanation - factor does not split `e^{x-y}` in Maxima into `e^{x}e^{y}`:: sage: desolve(diff(y,x)==exp(x-y),y,show_method=True) [-e^x + e^y(x) == c, 'exact'] You can solve Bessel equations. You can also use initial conditions, but you cannot put (sometimes desired) initial condition at x=0, since this point is singlar point of the equation. Anyway, if the solution should be bounded at x=0, then k2=0.:: sage: desolve(x^2*diff(y,x,x)+x*diff(y,x)+(x^2-4)*y==0,y) k1*bessel_j(2, x) + k2*bessel_y(2, x) Difficult ODE produces error:: sage: desolve(sqrt(y)*diff(y,x)+e^(y)+cos(x)-sin(x+y)==0,y) # not tested Traceback (click to the left for traceback) ... NotImplementedError, "Maxima was unable to solve this ODE. Consider to set option contrib_ode to True." Difficult ODE produces error - moreover, takes a long time :: sage: desolve(sqrt(y)*diff(y,x)+e^(y)+cos(x)-sin(x+y)==0,y,contrib_ode=True) # not tested Some more types od ODE's:: sage: desolve(x*diff(y,x)^2-(1+x*y)*diff(y,x)+y==0,y,contrib_ode=True,show_method=True) [[y(x) == c + log(x), y(x) == c*e^x], 'factor'] :: sage: desolve(diff(y,x)==(x+y)^2,y,contrib_ode=True,show_method=True) [[[x == c - arctan(sqrt(t)), y(x) == -x - sqrt(t)], [x == c + arctan(sqrt(t)), y(x) == -x + sqrt(t)]], 'lagrange'] These two examples produce error (as expected, Maxima 5.18 cannot solve equations from initial conditions). Current Maxima 5.18 returns false answer in this case!:: sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y,[0,1,2]).expand() # not tested Traceback (click to the left for traceback) ... NotImplementedError, "Maxima was unable to solve this ODE. Consider to set option contrib_ode to True." :: sage: desolve(diff(y,x,2)+y*(diff(y,x,1))^3==0,y,[0,1,2],show_method=True) # not tested Traceback (click to the left for traceback) ... NotImplementedError, "Maxima was unable to solve this ODE. Consider to set option contrib_ode to True." Second order linear ODE:: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y) (k2*x + k1)*e^(-x) + 1/2*sin(x) :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,show_method=True) [(k2*x + k1)*e^(-x) + 1/2*sin(x), 'variationofparameters'] :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,[0,3,1]) 1/2*(7*x + 6)*e^(-x) + 1/2*sin(x) :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,[0,3,1],show_method=True) [1/2*(7*x + 6)*e^(-x) + 1/2*sin(x), 'variationofparameters'] :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,[0,3,pi/2,2]) 3*((e^(1/2*pi) - 2)*x/pi + 1)*e^(-x) + 1/2*sin(x) :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == cos(x),y,[0,3,pi/2,2],show_method=True) [3*((e^(1/2*pi) - 2)*x/pi + 1)*e^(-x) + 1/2*sin(x), 'variationofparameters'] :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y) (k2*x + k1)*e^(-x) :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,show_method=True) [(k2*x + k1)*e^(-x), 'constcoeff'] :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,[0,3,1]) (4*x + 3)*e^(-x) :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,[0,3,1],show_method=True) [(4*x + 3)*e^(-x), 'constcoeff'] :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,[0,3,pi/2,2]) (2*(2*e^(1/2*pi) - 3)*x/pi + 3)*e^(-x) :: sage: desolve(diff(y,x,2)+2*diff(y,x)+y == 0,y,[0,3,pi/2,2],show_method=True) [(2*(2*e^(1/2*pi) - 3)*x/pi + 3)*e^(-x), 'constcoeff'] This equation can be solved within Maxima but not within Sage. It needs assumptions assume(x>0,y>0) and works in Maxima, but not in Sage:: sage: assume(x>0) # not tested sage: assume(y>0) # not tested sage: desolve(x*diff(y,x)-x*sqrt(y^2+x^2)-y,y,show_method=True) # not tested TESTS: Trac #6479 fixed:: sage: x = var('x') sage: y = function('y', x) sage: desolve( diff(y,x,x) == 0, y, [0,0,1]) x :: sage: desolve( diff(y,x,x) == 0, y, [0,1,1]) x + 1 Trac #9835 fixed:: sage: x = var('x') sage: y = function('y', x) sage: desolve(diff(y,x,2)+y*(1-y^2)==0,y,[0,-1,1,1]) Traceback (most recent call last): ... NotImplementedError: Unable to use initial condition for this equation (freeofx). AUTHORS: - David Joyner (1-2006) - Robert Bradshaw (10-2008) - Robert Marik (10-2009) """ if is_SymbolicEquation(de): de = de.lhs() - de.rhs() if is_SymbolicVariable(dvar): raise ValueError, "You have to declare dependent variable as a function, eg. y=function('y',x)" # for backwards compatibility if isinstance(dvar, list): dvar, ivar = dvar elif ivar is None: ivars = de.variables() ivars = [t for t in ivars if t is not dvar] if len(ivars) != 1: raise ValueError, "Unable to determine independent variable, please specify." ivar = ivars[0] def sanitize_var(exprs): return exprs.replace("'"+dvar_str+"("+ivar_str+")",dvar_str) de00 = de._maxima_() P = de00.parent() dvar_str=P(dvar.operator()).str() ivar_str=P(ivar).str() de00 = de00.str() de0 = sanitize_var(de00) ode_solver="ode2" cmd="(TEMP:%s(%s,%s,%s), if TEMP=false then TEMP else substitute(%s=%s(%s),TEMP))"%(ode_solver,de0,dvar_str,ivar_str,dvar_str,dvar_str,ivar_str) # we produce string like this # ode2('diff(y,x,2)+2*'diff(y,x,1)+y-cos(x),y(x),x) soln = P(cmd) if str(soln).strip() == 'false': if contrib_ode: ode_solver="contrib_ode" P("load('contrib_ode)") cmd="(TEMP:%s(%s,%s,%s), if TEMP=false then TEMP else substitute(%s=%s(%s),TEMP))"%(ode_solver,de0,dvar_str,ivar_str,dvar_str,dvar_str,ivar_str) # we produce string like this # (TEMP:contrib_ode(x*('diff(y,x,1))^2-(x*y+1)*'diff(y,x,1)+y,y,x), if TEMP=false then TEMP else substitute(y=y(x),TEMP)) soln = P(cmd) if str(soln).strip() == 'false': raise NotImplementedError, "Maxima was unable to solve this ODE." else: raise NotImplementedError, "Maxima was unable to solve this ODE. Consider to set option contrib_ode to True." if show_method: maxima_method=P("method") if (ics is not None): if not is_SymbolicEquation(soln.sage()): if not show_method: maxima_method=P("method") raise NotImplementedError, "Unable to use initial condition for this equation (%s)."%(str(maxima_method).strip()) if len(ics) == 2: tempic=(ivar==ics[0])._maxima_().str() tempic=tempic+","+(dvar==ics[1])._maxima_().str() cmd="(TEMP:ic1(%s(%s,%s,%s),%s),substitute(%s=%s(%s),TEMP))"%(ode_solver,de00,dvar_str,ivar_str,tempic,dvar_str,dvar_str,ivar_str) cmd=sanitize_var(cmd) # we produce string like this # (TEMP:ic2(ode2('diff(y,x,2)+2*'diff(y,x,1)+y-cos(x),y,x),x=0,y=3,'diff(y,x)=1),substitute(y=y(x),TEMP)) soln=P(cmd) if len(ics) == 3: #fixed ic2 command from Maxima - we have to ensure that %k1, %k2 do not depend on variables, should be removed when fixed in Maxima P("ic2_sage(soln,xa,ya,dya):=block([programmode:true,backsubst:true,singsolve:true,temp,%k2,%k1,TEMP_k], \ noteqn(xa), noteqn(ya), noteqn(dya), boundtest('%k1,%k1), boundtest('%k2,%k2), \ temp: lhs(soln) - rhs(soln), \ TEMP_k:solve([subst([xa,ya],soln), subst([dya,xa], lhs(dya)=-subst(0,lhs(dya),diff(temp,lhs(xa)))/diff(temp,lhs(ya)))],[%k1,%k2]), \ if not freeof(lhs(ya),TEMP_k) or not freeof(lhs(xa),TEMP_k) then return (false), \ temp: maplist(lambda([zz], subst(zz,soln)), TEMP_k), \ if length(temp)=1 then return(first(temp)) else return(temp))") tempic=P(ivar==ics[0]).str() tempic=tempic+","+P(dvar==ics[1]).str() tempic=tempic+",'diff("+dvar_str+","+ivar_str+")="+P(ics[2]).str() cmd="(TEMP:ic2_sage(%s(%s,%s,%s),%s),substitute(%s=%s(%s),TEMP))"%(ode_solver,de00,dvar_str,ivar_str,tempic,dvar_str,dvar_str,ivar_str) cmd=sanitize_var(cmd) # we produce string like this # (TEMP:ic2(ode2('diff(y,x,2)+2*'diff(y,x,1)+y-cos(x),y,x),x=0,y=3,'diff(y,x)=1),substitute(y=y(x),TEMP)) soln=P(cmd) if str(soln).strip() == 'false': raise NotImplementedError, "Maxima was unable to solve this IVP. Remove the initial condition to get the general solution." if len(ics) == 4: #fixed bc2 command from Maxima - we have to ensure that %k1, %k2 do not depend on variables, should be removed when fixed in Maxima P("bc2_sage(soln,xa,ya,xb,yb):=block([programmode:true,backsubst:true,singsolve:true,temp,%k1,%k2,TEMP_k], \ noteqn(xa), noteqn(ya), noteqn(xb), noteqn(yb), boundtest('%k1,%k1), boundtest('%k2,%k2), \ TEMP_k:solve([subst([xa,ya],soln), subst([xb,yb],soln)], [%k1,%k2]), \ if not freeof(lhs(ya),TEMP_k) or not freeof(lhs(xa),TEMP_k) then return (false), \ temp: maplist(lambda([zz], subst(zz,soln)),TEMP_k), \ if length(temp)=1 then return(first(temp)) else return(temp))") cmd="bc2_sage(%s(%s,%s,%s),%s,%s=%s,%s,%s=%s)"%(ode_solver,de00,dvar_str,ivar_str,P(ivar==ics[0]).str(),dvar_str,P(ics[1]).str(),P(ivar==ics[2]).str(),dvar_str,P(ics[3]).str()) cmd="(TEMP:%s,substitute(%s=%s(%s),TEMP))"%(cmd,dvar_str,dvar_str,ivar_str) cmd=sanitize_var(cmd) # we produce string like this # (TEMP:bc2(ode2('diff(y,x,2)+2*'diff(y,x,1)+y-cos(x),y,x),x=0,y=3,x=%pi/2,y=2),substitute(y=y(x),TEMP)) soln=P(cmd) if str(soln).strip() == 'false': raise NotImplementedError, "Maxima was unable to solve this BVP. Remove the initial condition to get the general solution." soln=soln.sage() if is_SymbolicEquation(soln) and soln.lhs() == dvar: # Remark: Here we do not check that the right hand side does not depend on dvar. # This probably will not hapen for soutions obtained via ode2, anyway. soln = soln.rhs() if show_method: return [soln,maxima_method.str()] else: return soln
0f7a619bba06b251004bdd04d43de0ac30bd6cc3 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9890/0f7a619bba06b251004bdd04d43de0ac30bd6cc3/desolvers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2832, 5390, 12, 323, 16, 302, 1401, 16, 277, 2143, 33, 7036, 16, 277, 1401, 33, 7036, 16, 2405, 67, 2039, 33, 8381, 16, 13608, 67, 390, 33, 8381, 4672, 436, 8395, 348, 355, 3324, 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, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2832, 5390, 12, 323, 16, 302, 1401, 16, 277, 2143, 33, 7036, 16, 277, 1401, 33, 7036, 16, 2405, 67, 2039, 33, 8381, 16, 13608, 67, 390, 33, 8381, 4672, 436, 8395, 348, 355, 3324, 279...
if not re.compile('[0-9][0-9]?\-[0-9]+-[0-9]+').match(bank.bvr_number or ''):
if not re.compile('[0-9][0-9]-[0-9]{3,6}-[0-9]').match(bank.bvr_number or ''):
def _check(self, cr, uid, data, context): for invoice in pooler.get_pool(cr.dbname).get('account.invoice').browse(cr, uid, data['ids'], context): bank = pooler.get_pool(cr.dbname).get('res.partner.bank').browse(cr, uid, data['form']['bank'], context) if not data['form']['bank']: raise wizard.except_wizard('UserError','No bank specified !') if not re.compile('[0-9][0-9]?\-[0-9]+-[0-9]+').match(bank.bvr_number or ''): raise wizard.except_wizard('UserError','Your bank BVR number should be of the form 0X-XXX-X !\nPlease check your company information.') if bank.bank_code and not re.compile('^[0-9]+$').match(bank.bank_code): raise wizard.except_wizard('UserError','Your bank code must be a number !\nPlease check your company information.') return {}
7047fc037732911be665b7c8fdffe0628fc2f5f2 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7397/7047fc037732911be665b7c8fdffe0628fc2f5f2/wizard_bvr.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 1893, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 819, 4672, 364, 9179, 316, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 2934, 588, 2668, 4631, 18, 16119, 16063, 25731, 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, 1893, 12, 2890, 16, 4422, 16, 4555, 16, 501, 16, 819, 4672, 364, 9179, 316, 2845, 264, 18, 588, 67, 6011, 12, 3353, 18, 20979, 2934, 588, 2668, 4631, 18, 16119, 16063, 25731, 12, ...
A class implementing all Bessel functions.
A class implementing the I, J, K, and Y Bessel functions.
def bessel_Y(nu,z,alg="maxima"): r""" Implements the "Y-Bessel function", or "Bessel function of the 2nd kind", with index (or "order") nu and argument z. Defn:
0090c116d1d0d5f9f5ec1cc4c8800a058defd9bb /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/0090c116d1d0d5f9f5ec1cc4c8800a058defd9bb/special.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 403, 292, 67, 61, 12, 13053, 16, 94, 16, 18413, 1546, 1896, 13888, 6, 4672, 436, 8395, 29704, 326, 315, 61, 17, 38, 403, 292, 445, 3113, 578, 315, 38, 403, 292, 445, 434, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 324, 403, 292, 67, 61, 12, 13053, 16, 94, 16, 18413, 1546, 1896, 13888, 6, 4672, 436, 8395, 29704, 326, 315, 61, 17, 38, 403, 292, 445, 3113, 578, 315, 38, 403, 292, 445, 434, 326, ...
self._render_property_changes(req, ticket, group['fields'])
self._render_property_changes(req, ticket, group['fields'], t)
def rendered_changelog_entries(self, req, ticket, when=None): """Iterate on changelog entries, consolidating related changes in a `dict` object. """ attachment_realm = ticket.resource.child('attachment') for group in self.grouped_changelog_entries(ticket, None, when): t = ticket.resource(version=group.get('cnum', None)) if 'TICKET_VIEW' in req.perm(t): self._render_property_changes(req, ticket, group['fields']) if 'attachment' in group['fields']: filename = group['fields']['attachment']['new'] attachment = attachment_realm(id=filename) if 'ATTACHMENT_VIEW' not in req.perm(attachment): del group['fields']['attachment'] if not group['fields']: continue yield group
ca20db658ac4c6ec54da7e47ec7e97559928594b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/2831/ca20db658ac4c6ec54da7e47ec7e97559928594b/web_ui.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7935, 67, 24083, 12970, 67, 8219, 12, 2890, 16, 1111, 16, 9322, 16, 1347, 33, 7036, 4672, 3536, 14916, 603, 21182, 3222, 16, 21785, 1776, 3746, 3478, 316, 279, 1375, 1576, 68, 733, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 7935, 67, 24083, 12970, 67, 8219, 12, 2890, 16, 1111, 16, 9322, 16, 1347, 33, 7036, 4672, 3536, 14916, 603, 21182, 3222, 16, 21785, 1776, 3746, 3478, 316, 279, 1375, 1576, 68, 733, 18, ...
if scanner.type != IHREAL:
if scanner.type != "IHREAL":
def getcoord(self): s = coord() scanner.next() if scanner.type != IHREAL: huh() return None
af15867a294e48006eba4fd9997cae401ccbfb05 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3176/af15867a294e48006eba4fd9997cae401ccbfb05/sst.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 5732, 12, 2890, 4672, 272, 273, 2745, 1435, 7683, 18, 4285, 1435, 309, 7683, 18, 723, 480, 315, 45, 44, 31052, 6877, 366, 89, 76, 1435, 327, 599, 2, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 5732, 12, 2890, 4672, 272, 273, 2745, 1435, 7683, 18, 4285, 1435, 309, 7683, 18, 723, 480, 315, 45, 44, 31052, 6877, 366, 89, 76, 1435, 327, 599, 2, -100, -100, -100, -100, -100, ...
TabPageLayout_5 = QGridLayout(self.TabPage_6,1,1,11,6,"TabPageLayout_5")
TabPageLayout_6 = QGridLayout(self.TabPage_6,1,1,11,6,"TabPageLayout_6")
def __init__(self,parent = None,name = None,modal = 0,fl = 0): QDialog.__init__(self,parent,name,modal,fl)
7cc18611a6df93ebc9707a8878e31fb8451f8ff6 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/11221/7cc18611a6df93ebc9707a8878e31fb8451f8ff6/UserPrefsDialog.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2938, 273, 599, 16, 529, 273, 599, 16, 17638, 273, 374, 16, 2242, 273, 374, 4672, 2238, 6353, 16186, 2738, 972, 12, 2890, 16, 2938, 16, 529, 16, 17638, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2938, 273, 599, 16, 529, 273, 599, 16, 17638, 273, 374, 16, 2242, 273, 374, 4672, 2238, 6353, 16186, 2738, 972, 12, 2890, 16, 2938, 16, 529, 16, 17638, ...
'renderer_activate', 'renderer_deactivate', 'renderer_part_changed', 'renderer_set_color', 'renderer_get_color', 'renderer_set_matrix', 'renderer_get_matrix', 'renderer_get_layout', 'renderer_get_layout_line', 'split_file_list', 'trim_string', 'quantize_line_geometry', 'version', 'version_string', 'version_check', 'cairo_font_map_new', 'cairo_font_map_new_for_font_type', 'cairo_font_map_get_default', 'cairo_font_map_set_default', 'cairo_font_map_get_font_type', 'cairo_font_map_set_resolution', 'cairo_font_map_get_resolution', 'cairo_font_map_create_context', 'cairo_font_get_scaled_font', 'cairo_update_context', 'cairo_context_set_font_options', 'cairo_context_get_font_options', 'cairo_context_set_resolution', 'cairo_context_get_resolution', 'cairo_create_context', 'cairo_create_layout', 'cairo_update_layout', 'cairo_show_glyph_string', 'cairo_show_glyph_item', 'cairo_show_layout_line', 'cairo_show_layout', 'cairo_show_error_underline', 'cairo_glyph_string_path', 'cairo_layout_line_path', 'cairo_layout_path', 'cairo_error_underline_path', 'Context', 'Layout', 'FontDescription', 'FontMap', 'CairoFontMap']
'renderer_draw_glyph', 'renderer_activate', 'renderer_deactivate', 'renderer_part_changed', 'renderer_set_color', 'renderer_get_color', 'renderer_set_matrix', 'renderer_get_matrix', 'renderer_get_layout', 'renderer_get_layout_line', 'split_file_list', 'trim_string', 'quantize_line_geometry', 'version', 'version_string', 'version_check', 'cairo_font_map_new', 'cairo_font_map_new_for_font_type', 'cairo_font_map_get_default', 'cairo_font_map_set_default', 'cairo_font_map_get_font_type', 'cairo_font_map_set_resolution', 'cairo_font_map_get_resolution', 'cairo_font_map_create_context', 'cairo_font_get_scaled_font', 'cairo_update_context', 'cairo_context_set_font_options', 'cairo_context_get_font_options', 'cairo_context_set_resolution', 'cairo_context_get_resolution', 'cairo_create_context', 'cairo_create_layout', 'cairo_update_layout', 'cairo_show_glyph_string', 'cairo_show_glyph_item', 'cairo_show_layout_line', 'cairo_show_layout', 'cairo_show_error_underline', 'cairo_glyph_string_path', 'cairo_layout_line_path', 'cairo_layout_path', 'cairo_error_underline_path', 'Context', 'Layout', 'FontDescription', 'FontMap', 'CairoFontMap']
def __init__(self, *args, **kwargs): self._internal = CairoFontMap.new(*args, **kwargs)._internal
92bb4862df49194567fad21ea00d921ffc62dd6a /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/10761/92bb4862df49194567fad21ea00d921ffc62dd6a/pango.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 16, 2826, 4333, 4672, 365, 6315, 7236, 273, 385, 10658, 303, 5711, 863, 18, 2704, 30857, 1968, 16, 2826, 4333, 2934, 67, 7236, 2, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 380, 1968, 16, 2826, 4333, 4672, 365, 6315, 7236, 273, 385, 10658, 303, 5711, 863, 18, 2704, 30857, 1968, 16, 2826, 4333, 2934, 67, 7236, 2, -100, -100, ...
'hardlink-accross-partition',
'hardlink-across-partition',
def check(self, pkg):
0342a22c778580f12cff4b2d58c4ef7213f13755 /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/10341/0342a22c778580f12cff4b2d58c4ef7213f13755/DuplicatesCheck.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 2890, 16, 3475, 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, 866, 12, 2890, 16, 3475, 4672, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
self.zoom_quality = gtk.gdk.INTERP_TILES
self.zoom_quality = gtk.gdk.INTERP_BILINEAR
def __init__(self):
d31eeff485216e462e9fae9fa766f140262d6e80 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2291/d31eeff485216e462e9fae9fa766f140262d6e80/mirage.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 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, 2738, 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, -1...
self._render(filename, dpi=dpi, figsize=self._figsize, **args)
self._render(filename, dpi=dpi, figsize=self._figsize, axes = axes, **args)
def show(self, filename=None, dpi=DEFAULT_DPI, figsize=DEFAULT_FIGSIZE, axes = None, **args): r""" Show this graphics array using the default viewer.
470406248ddd8d10123c37f20e3496c8a48c189b /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/470406248ddd8d10123c37f20e3496c8a48c189b/plot.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 12, 2890, 16, 1544, 33, 7036, 16, 16361, 33, 5280, 67, 40, 1102, 16, 14697, 33, 5280, 67, 5236, 4574, 16, 6515, 273, 599, 16, 2826, 1968, 4672, 436, 8395, 9674, 333, 17313, 526, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2405, 12, 2890, 16, 1544, 33, 7036, 16, 16361, 33, 5280, 67, 40, 1102, 16, 14697, 33, 5280, 67, 5236, 4574, 16, 6515, 273, 599, 16, 2826, 1968, 4672, 436, 8395, 9674, 333, 17313, 526, ...
print "IO Error on file open"
print "IO Error on file open. File missing or no premission to open."
def write_buf_cmd(self, buffer): """Write one word MSB,LSB to the serial port MSB first""" a=0 s=""
6d52e296d1c0e31feb3baa1215d74f9c5a101662 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/714/6d52e296d1c0e31feb3baa1215d74f9c5a101662/dongle.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 4385, 67, 4172, 12, 2890, 16, 1613, 4672, 3536, 3067, 1245, 2076, 9238, 38, 16, 3045, 38, 358, 326, 2734, 1756, 9238, 38, 1122, 8395, 279, 33, 20, 272, 1546, 6, 2, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1045, 67, 4385, 67, 4172, 12, 2890, 16, 1613, 4672, 3536, 3067, 1245, 2076, 9238, 38, 16, 3045, 38, 358, 326, 2734, 1756, 9238, 38, 1122, 8395, 279, 33, 20, 272, 1546, 6, 2, -100, -1...
self.node.setEventHandler(avg.CURSOROVER, avg.TOUCH|avg.MOUSE, self.onCursorDown)
self.node.setEventHandler(avg.CURSORDOWN, avg.TOUCH|avg.MOUSE, self.onCursorDown)
def init(self): global g_AudioInterface
65ded1f03792e2c1cbcbe056792a91bf32359ef7 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/7301/65ded1f03792e2c1cbcbe056792a91bf32359ef7/Game.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 12, 2890, 4672, 2552, 314, 67, 12719, 1358, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1208, 12, 2890, 4672, 2552, 314, 67, 12719, 1358, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -10...
ctcom = __import__("ctypes.com.server", globals(), locals(), ['*'])
ccom = __import__("comtypes.server.inprocserver", globals(), locals(), ['*'])
def DllGetClassObject(rclsid, riid, ppv): # First ask ctypes.com.server than comtypes.server for the # class object.
2abbc0f7412e42255ee3118a255cb590d619555f /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/2abbc0f7412e42255ee3118a255cb590d619555f/__init__.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 463, 2906, 967, 797, 921, 12, 86, 6429, 350, 16, 12347, 350, 16, 8228, 90, 4672, 468, 5783, 6827, 6983, 18, 832, 18, 3567, 2353, 532, 2352, 18, 3567, 364, 326, 468, 667, 733, 18, 2, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 463, 2906, 967, 797, 921, 12, 86, 6429, 350, 16, 12347, 350, 16, 8228, 90, 4672, 468, 5783, 6827, 6983, 18, 832, 18, 3567, 2353, 532, 2352, 18, 3567, 364, 326, 468, 667, 733, 18, 2, ...
z = repr_H_mod_N_over_d[d] v = [((u*x) % N, u, d, inverse_mod(x, N)) for x in z] reduct_data += v not_yet_done = list(set(not_yet_done).difference(set([a[0] for a in v]))) not_yet_done.sort() reduct_data.sort() reduct_data = [(a,b,c) for _,a,b,c in reduct_data]
for x in repr_H_mod_N_over_d[d]: reduct_data[(u*x)%N] = (u, d, inverse_mod(x,N))
def _coset_reduction_data_first_coord(G): """ Compute data used for determining the canonical coset representative of an element of SL_2(Z) modulo G. This function specfically returns data needed for the first part of the reduction step (the first coordinate).
87b6229f7390c9d09c32b459d5e79b72affaa765 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/87b6229f7390c9d09c32b459d5e79b72affaa765/congroup.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 14445, 278, 67, 1118, 4062, 67, 892, 67, 3645, 67, 5732, 12, 43, 4672, 3536, 8155, 501, 1399, 364, 23789, 326, 7378, 4987, 278, 23174, 434, 392, 930, 434, 348, 48, 67, 22, 12, 6...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 14445, 278, 67, 1118, 4062, 67, 892, 67, 3645, 67, 5732, 12, 43, 4672, 3536, 8155, 501, 1399, 364, 23789, 326, 7378, 4987, 278, 23174, 434, 392, 930, 434, 348, 48, 67, 22, 12, 6...
self.player.get_state(timeout=0.050)
self.player.get_state(timeout=50)
def scale_value_changed_cb(self, scale): # see seek.c:seek_cb real = long(scale.get_value() * self.p_duration / 100) # in ns gst.debug('value changed, perform seek to %r' % real) self.player.seek(real) # allow for a preroll self.player.get_state(timeout=0.050) # 50 ms
6dd77f1aa42b8e279a923dc4556b1a946603ca94 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1020/6dd77f1aa42b8e279a923dc4556b1a946603ca94/play.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3159, 67, 1132, 67, 6703, 67, 7358, 12, 2890, 16, 3159, 4672, 468, 2621, 6520, 18, 71, 30, 16508, 67, 7358, 2863, 273, 1525, 12, 5864, 18, 588, 67, 1132, 1435, 380, 365, 18, 84, 67, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 3159, 67, 1132, 67, 6703, 67, 7358, 12, 2890, 16, 3159, 4672, 468, 2621, 6520, 18, 71, 30, 16508, 67, 7358, 2863, 273, 1525, 12, 5864, 18, 588, 67, 1132, 1435, 380, 365, 18, 84, 67, ...
self.failUnless(y1.dtype == self.rdt, "Output dtype is %s, expected %s" % (y1.dtype, self.rdt))
self.failUnless(y.dtype == self.rdt, "Output dtype is %s, expected %s" % (y.dtype, self.rdt))
def test_definition(self): for t in [[1, 2, 3, 4, 1, 2, 3, 4], [1, 2, 3, 4, 1, 2, 3, 4, 5]]: x = np.array(t, dtype=self.rdt) y = rfft(x) y1 = direct_rdft(x) assert_array_almost_equal(y,y1) self.failUnless(y1.dtype == self.rdt, "Output dtype is %s, expected %s" % (y1.dtype, self.rdt))
d9d581fa33ac03f56c8bf423ac693d8f851e7cb9 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12971/d9d581fa33ac03f56c8bf423ac693d8f851e7cb9/test_basic.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 6907, 12, 2890, 4672, 364, 268, 316, 12167, 21, 16, 576, 16, 890, 16, 1059, 16, 404, 16, 576, 16, 890, 16, 1059, 6487, 306, 21, 16, 576, 16, 890, 16, 1059, 16, 404, 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, 1842, 67, 6907, 12, 2890, 4672, 364, 268, 316, 12167, 21, 16, 576, 16, 890, 16, 1059, 16, 404, 16, 576, 16, 890, 16, 1059, 6487, 306, 21, 16, 576, 16, 890, 16, 1059, 16, 404, 16, ...
if eqfn(items[j], obj):
if eqfn(lst.ll_getitem_fast(j), obj):
def ll_listindex(lst, obj, eqfn): items = lst.ll_items() lng = lst.ll_length() j = 0 while j < lng: if eqfn is None: if items[j] == obj: return j else: if eqfn(items[j], obj): return j j += 1 raise ValueError # can't say 'list.index(x): x not in list'
afabe8603c579750f81fa9c16896184dfa4a53b8 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/afabe8603c579750f81fa9c16896184dfa4a53b8/rlist.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6579, 67, 1098, 1615, 12, 16923, 16, 1081, 16, 7555, 4293, 4672, 1516, 273, 9441, 18, 2906, 67, 3319, 1435, 12662, 273, 9441, 18, 2906, 67, 2469, 1435, 525, 273, 374, 1323, 525, 411, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 6579, 67, 1098, 1615, 12, 16923, 16, 1081, 16, 7555, 4293, 4672, 1516, 273, 9441, 18, 2906, 67, 3319, 1435, 12662, 273, 9441, 18, 2906, 67, 2469, 1435, 525, 273, 374, 1323, 525, 411, 1...
_exposed_ = ('acquire', 'release', 'wait', 'notify', 'notify_all')
_exposed_ = ('acquire', 'release', 'wait', 'notify', 'notify_all', 'notifyAll')
def __exit__(self, exc_type, exc_val, exc_tb): return self._callmethod('release')
cbf574c8958e1c245aead767339693e9ab8e2856 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/827/cbf574c8958e1c245aead767339693e9ab8e2856/managers.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 8593, 972, 12, 2890, 16, 3533, 67, 723, 16, 3533, 67, 1125, 16, 3533, 67, 18587, 4672, 327, 365, 6315, 1991, 2039, 2668, 9340, 6134, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 8593, 972, 12, 2890, 16, 3533, 67, 723, 16, 3533, 67, 1125, 16, 3533, 67, 18587, 4672, 327, 365, 6315, 1991, 2039, 2668, 9340, 6134, 2, -100, -100, -100, -100, -100, -100, -100, ...
'basename': wikiutil.escape(basename),
'basename': wikiutil.escape(basename, 1),
def send_hotdraw(pagename, request): _ = request.getText now = time.time() pubpath = request.cfg.url_prefix_static + "/applets/TWikiDrawPlugin" basename = request.form['drawing'][0] drawpath = getAttachUrl(pagename, basename + '.draw', request, escaped=1) pngpath = getAttachUrl(pagename, basename + '.png', request, escaped=1) pagelink = attachUrl(request, pagename, '', action=action_name, ts=now) helplink = Page(request, "HelpOnActions/AttachFile").url(request) savelink = attachUrl(request, pagename, '', action=action_name, do='savedrawing') #savelink = Page(request, pagename).url(request) # XXX include target filename param here for twisted # request, {'savename': request.form['drawing'][0]+'.draw'} #savelink = '/cgi-bin/dumpform.bat' timestamp = '&amp;ts=%s' % now request.write('<h2>' + _("Edit drawing") + '</h2>') request.write("""
c901b8200843f0824a7653b6f81c9d40168288d2 /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/888/c901b8200843f0824a7653b6f81c9d40168288d2/AttachFile.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1366, 67, 15224, 9446, 12, 9095, 1069, 16, 590, 4672, 389, 273, 590, 18, 588, 1528, 225, 2037, 273, 813, 18, 957, 1435, 5634, 803, 273, 590, 18, 7066, 18, 718, 67, 3239, 67, 3845, 39...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 15224, 9446, 12, 9095, 1069, 16, 590, 4672, 389, 273, 590, 18, 588, 1528, 225, 2037, 273, 813, 18, 957, 1435, 5634, 803, 273, 590, 18, 7066, 18, 718, 67, 3239, 67, 3845, 39...
def longcmd(self, line):
def longcmd(self, line, fileHandle=None):
def longcmd(self, line): """Internal: send a command and get the response plus following text.""" self.putcmd(line) return self.getlongresp()
443dfbd0e8b6719520c49960538dfa3309a1c2f9 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/3187/443dfbd0e8b6719520c49960538dfa3309a1c2f9/nntplib.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1525, 4172, 12, 2890, 16, 980, 16, 26662, 33, 7036, 4672, 3536, 3061, 30, 1366, 279, 1296, 471, 336, 326, 766, 8737, 3751, 977, 12123, 365, 18, 458, 4172, 12, 1369, 13, 327, 365, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1525, 4172, 12, 2890, 16, 980, 16, 26662, 33, 7036, 4672, 3536, 3061, 30, 1366, 279, 1296, 471, 336, 326, 766, 8737, 3751, 977, 12123, 365, 18, 458, 4172, 12, 1369, 13, 327, 365, 18, ...
this = apply(_quickfix.new_CPRegType, args)
this = _quickfix.new_CPRegType(*args)
def __init__(self, *args): this = apply(_quickfix.new_CPRegType, 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, 4258, 1617, 559, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 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, 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, 4258, 1617, 559, 30857, 1968, 13, 775, 30, 365, 18, 2211, 18, 6923, 12, 2211, 13, 1335, 30, 3...
@type regex: String
@type regex: CharSequence
def split(regex, string): """ Splits a string by the occurrences of a regular expression. @type regex: String @param regex: regular expression to use as the separator @type string: String @param string: string to split @rtype: List @return: list of all sub strings that didn't match the regular expression """ if regex == '': return map(lambda x: x, string) else: return re.split(re.compile(regex), string)
e9c7052663249c90b14829b88b73bce6c9aa084d /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/12447/e9c7052663249c90b14829b88b73bce6c9aa084d/PyCore.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 12, 7584, 16, 533, 4672, 3536, 5385, 87, 279, 533, 635, 326, 15698, 434, 279, 6736, 2652, 18, 225, 632, 723, 3936, 30, 9710, 632, 891, 3936, 30, 6736, 2652, 358, 999, 487, 326, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1416, 12, 7584, 16, 533, 4672, 3536, 5385, 87, 279, 533, 635, 326, 15698, 434, 279, 6736, 2652, 18, 225, 632, 723, 3936, 30, 9710, 632, 891, 3936, 30, 6736, 2652, 358, 999, 487, 326, ...
self.assertEqual(sorted(self.t1.int[1,:]), sorted(self.t1.int[1,:]))
self.assertEqual(sorted(self.t1.int[1,:]), sorted(self.t2.int[1,:]))
def test_cluster_nneighb_only_table(self): self.assertEqual(sorted(self.t1.int[1,:]), sorted(self.t1.int[1,:]))
29359bb17dff1c528a9eaff983ea8b7683454140 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/8914/29359bb17dff1c528a9eaff983ea8b7683454140/test_cluster.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1842, 67, 7967, 67, 82, 11166, 67, 3700, 67, 2121, 12, 2890, 4672, 365, 18, 11231, 5812, 12, 10350, 12, 2890, 18, 88, 21, 18, 474, 63, 21, 16, 26894, 3631, 3115, 12, 2890, 18, 88, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 7967, 67, 82, 11166, 67, 3700, 67, 2121, 12, 2890, 4672, 365, 18, 11231, 5812, 12, 10350, 12, 2890, 18, 88, 21, 18, 474, 63, 21, 16, 26894, 3631, 3115, 12, 2890, 18, 88, ...
if self.debug: log.msg('ftp_PASV') if not self.shell: if self.debug: log.msg('ftp_PASV returning, user not logged in') self.reply(NOT_LOGGED_IN) return
log.debug('ftp_PASV')
def ftp_PASV(self, *_): """Request for a passive connection
cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12595/cdcaf038ab7a8d9d6eba20fa49c93c98c9d905a0/jdftp.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13487, 67, 52, 3033, 58, 12, 2890, 16, 380, 67, 4672, 3536, 691, 364, 279, 23697, 1459, 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, ...
[ 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13487, 67, 52, 3033, 58, 12, 2890, 16, 380, 67, 4672, 3536, 691, 364, 279, 23697, 1459, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100,...
if temp.find('://') > 0: self.protocol, temp = splitterm(temp, '://') self.server, temp = splitterm(temp,'/') if self.server.find(':') > 0: self.server, self.port = splitterm(self.server, ':') if temp.find(' temp, self.anchor = splitterm(temp, ' if temp.find('?') > 0: temp, self.parameter = splitterm(temp, '?') temp = string.split(temp, '/')
if not path : return if path[0] == '' : path = path[1:]
def __init__(self, uri):
4cc4d01d5479a695fcf128146a17545a587923d7 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1319/4cc4d01d5479a695fcf128146a17545a587923d7/URLParse.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2003, 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, ...
[ 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, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 2003, 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...
if self.downloading_art: return
def update_album_art(self): if self.downloading_art: return self.stop_art_update = True while self.updating_art: gtk.main_iteration() thread = threading.Thread(target=self.update_album_art2) thread.start()
7887607cb534b053442ac9710ec7241659a64004 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/2312/7887607cb534b053442ac9710ec7241659a64004/sonata.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 25090, 67, 485, 12, 2890, 4672, 365, 18, 5681, 67, 485, 67, 2725, 273, 1053, 1323, 365, 18, 5533, 1776, 67, 485, 30, 22718, 18, 5254, 67, 16108, 1435, 2650, 273, 17254, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1089, 67, 25090, 67, 485, 12, 2890, 4672, 365, 18, 5681, 67, 485, 67, 2725, 273, 1053, 1323, 365, 18, 5533, 1776, 67, 485, 30, 22718, 18, 5254, 67, 16108, 1435, 2650, 273, 17254, 18, ...
if sys.getwindowsversion().platform < 2: TESTFN_UNENCODABLE = None else:
if sys.getwindowsversion().platform >= 2:
def fcmp(x, y): # fuzzy comparison function if isinstance(x, float) or isinstance(y, float): try: fuzz = (abs(x) + abs(y)) * FUZZ if abs(x-y) <= fuzz: return 0 except: pass elif type(x) == type(y) and isinstance(x, (tuple, list)): for i in range(min(len(x), len(y))): outcome = fcmp(x[i], y[i]) if outcome != 0: return outcome return (len(x) > len(y)) - (len(x) < len(y)) return (x > y) - (x < y)
ff6fdccca7298d62dd694ea29af9dfe3026e3b72 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/12029/ff6fdccca7298d62dd694ea29af9dfe3026e3b72/support.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8036, 1291, 12, 92, 16, 677, 4672, 468, 21315, 5826, 445, 309, 1549, 12, 92, 16, 1431, 13, 578, 1549, 12, 93, 16, 1431, 4672, 775, 30, 31839, 273, 261, 5113, 12, 92, 13, 397, 2417, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 8036, 1291, 12, 92, 16, 677, 4672, 468, 21315, 5826, 445, 309, 1549, 12, 92, 16, 1431, 13, 578, 1549, 12, 93, 16, 1431, 4672, 775, 30, 31839, 273, 261, 5113, 12, 92, 13, 397, 2417, ...
if not self.bIsDispatch:
if not self.bIsDispatch and not self.type_attr.typekind == pythoncom.TKIND_DISPATCH:
def WriteClass(self, generator): wTypeFlags = self.type_attr.wTypeFlags if not self.bIsDispatch: return # This is pretty screwey - now we have vtable support we # should probably rethink this (ie, maybe write both sides for sinks, etc) if self.bIsSink: self.WriteEventSinkClassHeader(generator) self.WriteCallbackClassBody(generator) else: self.WriteClassHeader(generator) self.WriteClassBody(generator) print self.bWritten = 1
2292a688953cd916ea05888ece1c2b1a2e9af04a /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/992/2292a688953cd916ea05888ece1c2b1a2e9af04a/genpy.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 2598, 797, 12, 2890, 16, 4456, 4672, 341, 559, 5094, 273, 365, 18, 723, 67, 1747, 18, 91, 559, 5094, 309, 486, 365, 18, 70, 2520, 5325, 471, 486, 365, 18, 723, 67, 1747, 18, 723, 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, 2598, 797, 12, 2890, 16, 4456, 4672, 341, 559, 5094, 273, 365, 18, 723, 67, 1747, 18, 91, 559, 5094, 309, 486, 365, 18, 70, 2520, 5325, 471, 486, 365, 18, 723, 67, 1747, 18, 723, 9...
M = self.adjacency_matrix(boundary_first=boundary_first, over_integers=True)
M = self.adjacency_matrix(boundary_first=boundary_first)
def kirchhoff_matrix(self, weighted=None, boundary_first=False): """ Returns the Kirchhoff matrix (a.k.a. the Laplacian) of the graph. The Kirchhoff matrix is defined to be D - M, where D is the diagonal degree matrix (each diagonal entry is the degree of the corresponding vertex), and M is the adjacency matrix.
d067cb40b1bc48cd4a4208c39a8023684e3cecbe /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9890/d067cb40b1bc48cd4a4208c39a8023684e3cecbe/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 417, 481, 343, 76, 3674, 67, 5667, 12, 2890, 16, 13747, 33, 7036, 16, 7679, 67, 3645, 33, 8381, 4672, 3536, 2860, 326, 1475, 481, 343, 76, 3674, 3148, 261, 69, 18, 79, 18, 69, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 417, 481, 343, 76, 3674, 67, 5667, 12, 2890, 16, 13747, 33, 7036, 16, 7679, 67, 3645, 33, 8381, 4672, 3536, 2860, 326, 1475, 481, 343, 76, 3674, 3148, 261, 69, 18, 79, 18, 69, 18, ...
else: return HttpClient._prepare_connection(self, url, headers)
def _prepare_connection(self, url, headers): proxy_auth = _get_proxy_auth(url.protocol) if url.protocol == 'https': # destination is https proxy = os.environ.get('https_proxy') if proxy: # Set any proxy auth headers if proxy_auth: proxy_auth = 'Proxy-authorization: %s' % proxy_auth # Construct the proxy connect command. port = url.port if not port: port = '443' proxy_connect = 'CONNECT %s:%s HTTP/1.0\r\n' % (url.host, port) # Set the user agent to send to the proxy if headers and 'User-Agent' in headers: user_agent = 'User-Agent: %s\r\n' % (headers['User-Agent']) else: user_agent = '' proxy_pieces = '%s%s%s\r\n' % (proxy_connect, proxy_auth, user_agent) # Find the proxy host and port. proxy_url = atom.url.parse_url(proxy) if not proxy_url.port: proxy_url.port = '80' # Connect to the proxy server, very simple recv and error checking p_sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) p_sock.connect((proxy_url.host, int(proxy_url.port))) p_sock.sendall(proxy_pieces) response = ''
11f531b223a4a1d050d708ce7833bb657986433f /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/10620/11f531b223a4a1d050d708ce7833bb657986433f/http.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 9366, 67, 4071, 12, 2890, 16, 880, 16, 1607, 4672, 2889, 67, 1944, 273, 389, 588, 67, 5656, 67, 1944, 12, 718, 18, 8373, 13, 309, 880, 18, 8373, 422, 296, 4528, 4278, 468, 2929,...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 9366, 67, 4071, 12, 2890, 16, 880, 16, 1607, 4672, 2889, 67, 1944, 273, 389, 588, 67, 5656, 67, 1944, 12, 718, 18, 8373, 13, 309, 880, 18, 8373, 422, 296, 4528, 4278, 468, 2929,...
self._browser.open("http://%s/testfile/uploadform" % self._host) self._browser.select_form("test_result_upload") for (name, data) in attrs: self._browser[name] = str(data) for (filename, handle) in file_objs: self._browser.add_file(handle, get_mime_type(filename), filename, "file") self._browser.submit()
url = "http://%s/testfile/upload" % self._host content_type, data = _encode_multipart_form_data(attrs, file_objs) headers = {"Content-Type": content_type} request = urllib2.Request(url, data, headers) urllib2.urlopen(request, timeout=60)
def _upload_files(self, attrs, file_objs): self._browser.open("http://%s/testfile/uploadform" % self._host) self._browser.select_form("test_result_upload") for (name, data) in attrs: self._browser[name] = str(data)
ea2048311c630d04e50d3ebae1c4699a9191c00c /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/9392/ea2048311c630d04e50d3ebae1c4699a9191c00c/test_results_uploader.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 6327, 67, 2354, 12, 2890, 16, 3422, 16, 585, 67, 18093, 4672, 365, 6315, 11213, 18, 3190, 2932, 2505, 23155, 87, 19, 3813, 768, 19, 6327, 687, 6, 738, 365, 6315, 2564, 13, 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, 389, 6327, 67, 2354, 12, 2890, 16, 3422, 16, 585, 67, 18093, 4672, 365, 6315, 11213, 18, 3190, 2932, 2505, 23155, 87, 19, 3813, 768, 19, 6327, 687, 6, 738, 365, 6315, 2564, 13, 365, ...
return self._ExpandPathNodes(self.GetRootItem(), paths)
rootnode = self.GetPyData(self.GetRootItem()) paths = set(paths) paths.discard(rootnode.path) if paths: return self._ExpandPathNodes(rootnode, paths)
def ExpandPathNodes(self, paths): return self._ExpandPathNodes(self.GetRootItem(), paths)
04e8b983517b6f3f4e73d11d47d05ce7877b199b /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/11441/04e8b983517b6f3f4e73d11d47d05ce7877b199b/dirtree.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16429, 743, 3205, 12, 2890, 16, 2953, 4672, 327, 365, 6315, 12271, 743, 3205, 12, 2890, 18, 967, 2375, 1180, 9334, 2953, 13, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 16429, 743, 3205, 12, 2890, 16, 2953, 4672, 327, 365, 6315, 12271, 743, 3205, 12, 2890, 18, 967, 2375, 1180, 9334, 2953, 13, 2, -100, -100, -100, -100, -100, -100, -100, -100, -100, -100...
logfilename = self.TMP_DIR + ("/%s." % tool_name) + "%p"
logfilename = self.temp_dir + ("/%s." % tool_name) + "%p"
def ToolCommand(self): """Get the valgrind command to run.""" # Note that self._args begins with the exe to be run. tool_name = self.ToolName()
09a4f701e8a53003ff9f43042db088214ef61594 /local1/tlutelli/issta_data/temp/all_python//python/2010_temp/2010/5060/09a4f701e8a53003ff9f43042db088214ef61594/valgrind_test.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 13288, 2189, 12, 2890, 4672, 3536, 967, 326, 1244, 3197, 728, 1296, 358, 1086, 12123, 468, 3609, 716, 365, 6315, 1968, 17874, 598, 326, 15073, 358, 506, 1086, 18, 5226, 67, 529, 273, 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, 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, 13288, 2189, 12, 2890, 4672, 3536, 967, 326, 1244, 3197, 728, 1296, 358, 1086, 12123, 468, 3609, 716, 365, 6315, 1968, 17874, 598, 326, 15073, 358, 506, 1086, 18, 5226, 67, 529, 273, 365...
""" register a new transform """
"""register a new transform transform isn't a Zope Transform (the wrapper) but the wrapped transform the persistence wrapper will be created here """
def registerTransform(self, name, transform): """ register a new transform """ __traceback_info__ = (name, transform) if not name in self.objectIds(): # needed when call from transform.transforms.initialize which # register non zope transform module = "%s" % transform.__module__ transform = Transform(name, module, transform) self._setObject(name, transform) self._mapTransform(transform)
e16c990f973275ed437c33640d38621865fddd33 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12165/e16c990f973275ed437c33640d38621865fddd33/TransformTool.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 4059, 12, 2890, 16, 508, 16, 2510, 4672, 3536, 4861, 279, 394, 2510, 225, 2510, 5177, 1404, 279, 2285, 1306, 11514, 261, 5787, 4053, 13, 1496, 326, 5805, 2510, 326, 9756, 4053, 903...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1744, 4059, 12, 2890, 16, 508, 16, 2510, 4672, 3536, 4861, 279, 394, 2510, 225, 2510, 5177, 1404, 279, 2285, 1306, 11514, 261, 5787, 4053, 13, 1496, 326, 5805, 2510, 326, 9756, 4053, 903...
@login_required def set_patches(request): context = PatchworkRequestContext(request)
def public(request, username, bundlename): user = get_object_or_404(User, username = username) bundle = get_object_or_404(Bundle, name = bundlename, public = True) filter_settings = [(DelegateFilter, DelegateFilter.AnyDelegate)] context = generic_list(request, bundle.project, 'patchwork.views.bundle.public', view_args = {'username': username, 'bundlename': bundlename}, filter_settings = filter_settings, patches = bundle.patches.all()) context.update({'bundle': bundle, 'user': user}); return render_to_response('patchwork/bundle-public.html', context)
8e8be3bcc0db37a92e12fe3ee2a3351c7a6bbcd9 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/7754/8e8be3bcc0db37a92e12fe3ee2a3351c7a6bbcd9/bundle.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1071, 12, 2293, 16, 2718, 16, 324, 1074, 14724, 4672, 729, 273, 336, 67, 1612, 67, 280, 67, 11746, 12, 1299, 16, 2718, 273, 2718, 13, 3440, 273, 336, 67, 1612, 67, 280, 67, 11746, 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, 1071, 12, 2293, 16, 2718, 16, 324, 1074, 14724, 4672, 729, 273, 336, 67, 1612, 67, 280, 67, 11746, 12, 1299, 16, 2718, 273, 2718, 13, 3440, 273, 336, 67, 1612, 67, 280, 67, 11746, 12...
assert (variable_families.find_rep(link.args[i]) == variable_families.find_rep(link.args[j])) del link.args[i] except StopIteration: pass
v = link.args[i] if isinstance(v, Constant): break key.append(variable_families.find_rep(v)) else: key = tuple(key) if key not in entryargs: entryargs[key] = i else: j = entryargs[key] argi = block.inputargs[i] argj = block.inputargs[j] block.renamevariables({argi: argj}) assert block.inputargs[i] == block.inputargs[j]== argj del block.inputargs[i] for link in links: assert (variable_families.find_rep(link.args[i])== variable_families.find_rep(link.args[j])) del link.args[i] progress = True break
def merges(varlist): d = {} for i in range(len(varlist)): v = variable_families.find_rep(varlist[i]) if v in d: yield d[v], i d[v] = i
73344188ad55ff78c780e5d8d1c1f2c8d1fb5a09 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6934/73344188ad55ff78c780e5d8d1c1f2c8d1fb5a09/simplify.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19037, 12, 1401, 1098, 4672, 302, 273, 2618, 364, 277, 316, 1048, 12, 1897, 12, 1401, 1098, 3719, 30, 331, 273, 2190, 67, 74, 14319, 18, 4720, 67, 14462, 12, 1401, 1098, 63, 77, 5717, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 19037, 12, 1401, 1098, 4672, 302, 273, 2618, 364, 277, 316, 1048, 12, 1897, 12, 1401, 1098, 3719, 30, 331, 273, 2190, 67, 74, 14319, 18, 4720, 67, 14462, 12, 1401, 1098, 63, 77, 5717, ...
def tearDown(self): if os.path.exists(self.mbox_name): os.remove(self.mbox_name) class TestMboxRemove(unittest.TestCase): def setUp(self):
class TestMboxRemove(TestCaseInTempdir): def setUp(self): super(TestMboxRemove, self).setUp()
def tearDown(self): if os.path.exists(self.mbox_name): os.remove(self.mbox_name)
e491da3a113ed15e5966a78b4461613b56c4b582 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/1746/e491da3a113ed15e5966a78b4461613b56c4b582/test_archivemail.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 268, 2091, 4164, 12, 2890, 4672, 309, 1140, 18, 803, 18, 1808, 12, 2890, 18, 81, 2147, 67, 529, 4672, 1140, 18, 4479, 12, 2890, 18, 81, 2147, 67, 529, 13, 2, 0, 0, 0, 0, 0, 0, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 268, 2091, 4164, 12, 2890, 4672, 309, 1140, 18, 803, 18, 1808, 12, 2890, 18, 81, 2147, 67, 529, 4672, 1140, 18, 4479, 12, 2890, 18, 81, 2147, 67, 529, 13, 2, -100, -100, -100, -100, ...
vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 dr = (0, 0, vr[2], 0)
x0, y0, x1, y1 = self.wid.GetWindowPort().portRect x0 = x0 + 4 y0 = y0 + 4 x1 = x1 - 20 y1 = y1 - 20 vr = dr = x0, y0, x1, y1
def open(self, path, name, data): self.path = path self.name = name r = windowbounds(400, 400) w = Win.NewWindow(r, name, 1, 0, -1, 1, 0x55555555) self.wid = w vr = 0, 0, r[2]-r[0]-15, r[3]-r[1]-15 dr = (0, 0, vr[2], 0) Qd.SetPort(w) Qd.TextFont(4) Qd.TextSize(9) self.ted = TE.TENew(dr, vr) self.ted.TEAutoView(1) self.ted.TESetText(data) w.DrawGrowIcon() self.scrollbars() self.changed = 0 self.do_postopen() self.do_activate(1, None)
3e312004787765dd9906d35190767ee643bf4317 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/8125/3e312004787765dd9906d35190767ee643bf4317/ped.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1696, 12, 2890, 16, 589, 16, 508, 16, 501, 4672, 365, 18, 803, 273, 589, 365, 18, 529, 273, 508, 436, 273, 2742, 10576, 12, 16010, 16, 7409, 13, 341, 273, 21628, 18, 1908, 3829, 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, 1696, 12, 2890, 16, 589, 16, 508, 16, 501, 4672, 365, 18, 803, 273, 589, 365, 18, 529, 273, 508, 436, 273, 2742, 10576, 12, 16010, 16, 7409, 13, 341, 273, 21628, 18, 1908, 3829, 12, ...
M = self.adjacency_matrix(boundary_first=boundary_first, over_integers=True)
M = self.adjacency_matrix(boundary_first=boundary_first)
def kirchhoff_matrix(self, weighted=None, boundary_first=False): """ Returns the Kirchhoff matrix (a.k.a. the Laplacian) of the graph.
eed3623c0caa3c0a2126620432702d05dae34083 /local1/tlutelli/issta_data/temp/all_python//python/2008_temp/2008/9417/eed3623c0caa3c0a2126620432702d05dae34083/graph.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 417, 481, 343, 76, 3674, 67, 5667, 12, 2890, 16, 13747, 33, 7036, 16, 7679, 67, 3645, 33, 8381, 4672, 3536, 2860, 326, 1475, 481, 343, 76, 3674, 3148, 261, 69, 18, 79, 18, 69, 18, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 417, 481, 343, 76, 3674, 67, 5667, 12, 2890, 16, 13747, 33, 7036, 16, 7679, 67, 3645, 33, 8381, 4672, 3536, 2860, 326, 1475, 481, 343, 76, 3674, 3148, 261, 69, 18, 79, 18, 69, 18, ...
timeouts = (0, 0, timeout*1000, 0, timeout*1000)
timeouts = (0, 0, int(timeout*1000), 0, int(timeout*1000))
def __init__(self, port, #number of device, numbering starts at #zero. if everything fails, the user #can specify a device string, note #that this isn't portable anymore baudrate=9600, #baudrate bytesize=EIGHTBITS, #number of databits parity=PARITY_NONE, #enable parity checking stopbits=STOPBITS_ONE, #number of stopbits timeout=None, #set a timeout value, None for waiting forever xonxoff=0, #enable software flow control rtscts=0, #enable RTS/CTS flow control ): """initialize comm port"""
d81e49e7efdb6c6509670d0fc02829d4c907b529 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/10955/d81e49e7efdb6c6509670d0fc02829d4c907b529/serialwin32.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 2738, 972, 12, 2890, 16, 1756, 16, 5375, 468, 2696, 434, 2346, 16, 1300, 310, 2542, 622, 468, 7124, 18, 309, 7756, 6684, 16, 326, 729, 468, 4169, 4800, 279, 2346, 533, 16, 4721, ...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1756, 16, 5375, 468, 2696, 434, 2346, 16, 1300, 310, 2542, 622, 468, 7124, 18, 309, 7756, 6684, 16, 326, 729, 468, 4169, 4800, 279, 2346, 533, 16, 4721, ...
print 'Restoring iptables...' fireWall.flushBanList() print 'Exiting...'
logSys.info("Restoring iptables...") fireWall.flushBanList(debug) logSys.info("Exiting...")
def createDaemon(): """Detach a process from the controlling terminal and run it in the background as a daemon. http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/278731 """ try: # Fork a child process so the parent can exit. This will return control # to the command line or shell. This is required so that the new process # is guaranteed not to be a process group leader. We have this guarantee # because the process GID of the parent is inherited by the child, but # the child gets a new PID, making it impossible for its PID to equal its # PGID. pid = os.fork() except OSError, e: return((e.errno, e.strerror)) # ERROR (return a tuple) if (pid == 0): # The first child. # Next we call os.setsid() to become the session leader of this new # session. The process also becomes the process group leader of the # new process group. Since a controlling terminal is associated with a # session, and this new session has not yet acquired a controlling # terminal our process now has no controlling terminal. This shouldn't # fail, since we're guaranteed that the child is not a process group # leader. os.setsid() # When the first child terminates, all processes in the second child # are sent a SIGHUP, so it's ignored. signal.signal(signal.SIGHUP, signal.SIG_IGN) try: # Fork a second child to prevent zombies. Since the first child is # a session leader without a controlling terminal, it's possible for # it to acquire one by opening a terminal in the future. This second # fork guarantees that the child is no longer a session leader, thus # preventing the daemon from ever acquiring a controlling terminal. pid = os.fork() # Fork a second child. except OSError, e: return((e.errno, e.strerror)) # ERROR (return a tuple) if (pid == 0): # The second child. # Ensure that the daemon doesn't keep any directory in use. Failure # to do this could make a filesystem unmountable. #os.chdir("/") # Give the child complete control over permissions. os.umask(0) else: os._exit(0) # Exit parent (the first child) of the second child. else: os._exit(0) # Exit parent of the first child. # Close all open files. Try the system configuration variable, SC_OPEN_MAX, # for the maximum number of open files to close. If it doesn't exist, use # the default value (configurable). try: maxfd = os.sysconf("SC_OPEN_MAX") except (AttributeError, ValueError): maxfd = 256 # default maximum for fd in range(0, maxfd): try: os.close(fd) except OSError: # ERROR (ignore) pass # Redirect the standard file descriptors to /dev/null. os.open("/dev/null", os.O_RDONLY) # standard input (0) #os.open("/dev/null", os.O_RDWR) # standard output (1) os.open("/tmp/fail2ban.log", os.O_CREAT|os.O_APPEND|os.O_RDWR) # standard output (1) #os.open("/dev/null", os.O_RDWR) # standard error (2) os.open("/tmp/fail2ban.log", os.O_CREAT|os.O_APPEND|os.O_RDWR) # standard error (2) return(0)
8eb470019c3884af2f9196a149974f0fd91270e1 /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/12171/8eb470019c3884af2f9196a149974f0fd91270e1/fail2ban.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 752, 12858, 13332, 3536, 17650, 279, 1207, 628, 326, 3325, 2456, 8651, 471, 1086, 518, 316, 326, 5412, 487, 279, 8131, 18, 225, 1062, 2207, 345, 7449, 18, 11422, 395, 340, 18, 832, 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, 752, 12858, 13332, 3536, 17650, 279, 1207, 628, 326, 3325, 2456, 8651, 471, 1086, 518, 316, 326, 5412, 487, 279, 8131, 18, 225, 1062, 2207, 345, 7449, 18, 11422, 395, 340, 18, 832, 19, ...
log.add("\nYou must provide a BVR number on the partner bank:"+pline.bank_id.name_get(cr,uid,[pline.bank_id.id],context)[0][1]+' (partner: '+pline.partner_id.name+').')
log.add("\nYou must provide a BVR number " "on the partner bank:" + \ res_partner_bank_obj.name_get(cr, uid, [pline.bank_id.id], context)[0][1] + \ ' (partner: ' + pline.partner_id.name + ').')
def _create_dta(self,cr,uid,data,context): v={} v['uid'] = str(uid) v['creation_date']= time.strftime('%y%m%d') log=Log() dta='' pool = pooler.get_pool(cr.dbname) payment= pool.get('payment.order').browse(cr,uid,data['id'],context) if not payment.mode or payment.mode.type.code != 'dta': return {'note':'No payment mode or payment type code invalid.'} bank= payment.mode.bank_id if not bank: return {'note':'No bank account for the company.'} v['comp_bank_name']= bank.bank_id and bank.bank_id.name or False v['comp_bank_clearing'] = bank.clearing if not v['comp_bank_clearing']: return {'note':'You must provide a Clearing Number for your bank account.'} user = pool.get('res.users').browse(cr,uid,[uid])[0] company= user.company_id co_addr= company.partner_id.address[0] v['comp_country'] = co_addr.country_id and co_addr.country_id.name or '' v['comp_street'] = co_addr.street or '' v['comp_zip'] = co_addr.zip v['comp_city'] = co_addr.city v['comp_name'] = co_addr.name v['comp_dta'] = ''#XXX not mandatory in pratice v['comp_bank_number'] = bank.acc_number or '' v['comp_bank_iban'] = bank.iban or '' if not v['comp_bank_iban'] : return {'note':'No iban number for the company bank account.'} inv_obj = pool.get('account.invoice') dta_line_obj = pool.get('account.dta.line') seq= 1 amount_tot = 0 th_amount_tot= 0 reconciles_and_st_lines= [] bk_st_id = pool.get('account.bank.statement').create(cr,uid,{ 'journal_id': payment.mode.journal.id, 'balance_start':0, 'balance_end_real':0, 'state':'draft', }) ## Fetch the invoices: cr.execute('''select i.id,pl.id from payment_line pl join account_move_line ml on (pl.move_line_id = ml.id) join account_move m on (ml.move_id = m.id) join account_invoice i on (i.move_id = m.id) join payment_order p on (pl.order_id = p.id) where p.id = %s '''%payment.id) payment_lines= [] invoices= [] for i,p in cr.fetchall(): payment_lines.append(p) invoices.append(i) line2inv= dict(zip(payment_lines, pool.get('account.invoice').browse(cr,uid,invoices,context))) del payment_lines, invoices for pline in payment.line_ids: i = line2inv[pline.id] invoice_number = i.number or '??' if not pline.bank_id: log.add('\nNo partner bank defined. (partner: '+pline.partner_id.name+', entry:'+pline.move_line_id.name+').') continue v['sequence'] = str(seq).rjust(5).replace(' ','0') v['amount_to_pay']= str(pline.amount).replace('.',',') v['invoice_number'] = invoice_number or '' v['invoice_currency'] = i.currency_id.code or '' if not v['invoice_currency'] : log.add('\nInvoice currency code undefined. (partner: '+pline.partner_id.name+', entry:'+pline.move_line_id.name+', invoice '+invoice_number+').') continue v['partner_bank_name'] = pline.bank_id.bank_id and pline.bank_id.bank_id.name or False v['partner_bank_clearing'] = pline.bank_id.clearing or False if not v['partner_bank_name'] : log.add('\nPartner bank account not well defined, please provide a name for the associated bank (partner: '+pline.partner_id.name+', bank:'+pline.bank_id.name_get(cr,uid,[pline.bank_id.id],context)[0][1]+').') continue v['partner_bank_iban']= pline.bank_id.iban or False v['partner_bank_number']= pline.bank_id.acc_number and pline.bank_id.acc_number.replace('.','').replace('-','') or False v['partner_post_number']= pline.bank_id.post_number and pline.bank_id.post_number.replace('.','').replace('-','') or False v['partner_bvr']= pline.bank_id.bvr_number or '' if v['partner_bvr']: v['partner_bvr']= v['partner_bvr'].replace('-','') if len(v['partner_bvr']) < 9: v['partner_bvr']= v['partner_bvr'][:2]+ '0'*(9-len(v['partner_bvr'])) +v['partner_bvr'][2:] if pline.bank_id.bank_address_id: v['partner_bank_city']= pline.bank_id.bank_address_id.city or False v['partner_bank_street']= pline.bank_id.bank_address_id.street or '' v['partner_bank_zip']= pline.bank_id.bank_address_id.zip or '' v['partner_bank_country']= pline.bank_id.bank_address_id.country_id and pline.bank_id.bank_address_id.country_id.name or '' v['partner_bank_code']= False # for future : place BIC number here v['invoice_reference']= i.reference v['invoice_bvr_num']= i.bvr_ref_num if v['invoice_bvr_num']: v['invoice_bvr_num'] = v['invoice_bvr_num'].replace(' ', '').rjust(27).replace(' ','0') v['partner_comment']= i.partner_comment v['partner_name'] = pline.partner_id and pline.partner_id.name or '' if pline.partner_id and pline.partner_id.address and pline.partner_id.address[0]: v['partner_street'] = pline.partner_id.address[0].street v['partner_city']= pline.partner_id.address[0].city v['partner_zip']= pline.partner_id.address[0].zip # If iban => country=country code for space reason elec_pay = pline.bank_id.state if elec_pay == 'iban': v['partner_country']= pline.partner_id.address[0].country_id and pline.partner_id.address[0].country_id.code+'-' or '' else: v['partner_country']= pline.partner_id.address[0].country_id and pline.partner_id.address[0].country_id.name or '' else: v['partner_street'] ='' v['partner_city']= '' v['partner_zip']= '' v['partner_country']= '' log.add('\nNo address for the partner: '+pline.partner_id.name) date_value= False if payment.date_prefered == 'fixed' and payment.date_planned: date_value = payment.date_planned elif payment.date_prefered == 'due': date_value = pline.due_date if date_value : date_value = mx.DateTime.strptime( date_value,'%Y-%m-%d') or mx.DateTime.now() v['date_value'] = date_value.strftime("%y%m%d") else: v['date_value'] = "000000" # si compte iban -> iban (836) # si payment structure -> bvr (826) # si non -> (827) if elec_pay == 'dta_iban': # If iban => country=country code for space reason v['comp_country'] = co_addr.country_id and co_addr.country_id.code+'-' or '' record_type = record_gt836 if not v['partner_bank_iban']: log.add('\nNo iban number for the partner bank:'+pline.bank_id.name_get(cr,uid,[pline.bank_id.id],context)[0][1]+' (partner: '+pline.partner_id.name+').') continue if v['partner_bank_code'] : # bank code is swift (BIC address) v['option_id_bank']= 'A' v['partner_bank_ident']= v['partner_bank_code'] elif v['partner_bank_city']: # # added by fabien #
1cbf0794771e53748b52e2d03915a75c29447f7c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/7339/1cbf0794771e53748b52e2d03915a75c29447f7c/dta_wizard.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 389, 2640, 67, 72, 2351, 12, 2890, 16, 3353, 16, 1911, 16, 892, 16, 2472, 4672, 282, 331, 12938, 331, 3292, 1911, 3546, 273, 609, 12, 1911, 13, 331, 3292, 17169, 67, 712, 3546, 33, 8...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 2640, 67, 72, 2351, 12, 2890, 16, 3353, 16, 1911, 16, 892, 16, 2472, 4672, 282, 331, 12938, 331, 3292, 1911, 3546, 273, 609, 12, 1911, 13, 331, 3292, 17169, 67, 712, 3546, 33, 8...
return getattr(self, select, attr)
return getattr(self.select, attr)
def __getattr__(self, attr): # @@: This passes through private variable access too... should it? # Also magic methods, like __str__ return getattr(self, select, attr)
db01e8cfb14548de138e02ee1bbcc2b7c562aadc /local1/tlutelli/issta_data/temp/all_python//python/2006_temp/2006/6718/db01e8cfb14548de138e02ee1bbcc2b7c562aadc/joins.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 1001, 588, 1747, 972, 12, 2890, 16, 1604, 4672, 468, 22175, 30, 1220, 11656, 3059, 3238, 2190, 2006, 4885, 2777, 1410, 518, 35, 468, 8080, 8146, 2590, 16, 3007, 1001, 701, 972, 327, 3869...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 1001, 588, 1747, 972, 12, 2890, 16, 1604, 4672, 468, 22175, 30, 1220, 11656, 3059, 3238, 2190, 2006, 4885, 2777, 1410, 518, 35, 468, 8080, 8146, 2590, 16, 3007, 1001, 701, 972, 327, 3869...
[u'%s@%s' % (username, settings.AD_DOMAIN_NAME)][0])
[u'%s@%s' % (username, settings.AD_DOMAIN_NAME)])[0]
def get_or_create_user(self, username, ad_user_data): try: user = User.objects.get(username=username) return user except User.DoesNotExist: try: user_info = ad_user_data[0][1]
a54c540450bfb95e0de147ecc56f70aa2cf2249f /local1/tlutelli/issta_data/temp/all_python//python/2009_temp/2009/1600/a54c540450bfb95e0de147ecc56f70aa2cf2249f/backends.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 336, 67, 280, 67, 2640, 67, 1355, 12, 2890, 16, 2718, 16, 1261, 67, 1355, 67, 892, 4672, 775, 30, 729, 273, 2177, 18, 6911, 18, 588, 12, 5053, 33, 5053, 13, 327, 729, 1335, 2177, 1...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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, 280, 67, 2640, 67, 1355, 12, 2890, 16, 2718, 16, 1261, 67, 1355, 67, 892, 4672, 775, 30, 729, 273, 2177, 18, 6911, 18, 588, 12, 5053, 33, 5053, 13, 327, 729, 1335, 2177, 1...
self.base_name = self.base_file = normpath(something)
def check(self, files_or_modules): """main checking entry: check a list of files or modules from their name. """ self.reporter.include_ids = self.config.include_ids if not isinstance(files_or_modules, (list, tuple)): files_or_modules = (files_or_modules,) checkers = sort_checkers(self._checkers.values()) rev_checkers = checkers[:] rev_checkers.reverse() # notify global begin for checker in checkers: checker.open() # check modules or packages for something in files_or_modules: self.base_name = self.base_file = normpath(something) if exists(something): # this is a file or a directory try: modname = '.'.join(modpath_from_file(something)) except ImportError: modname = splitext(basename(something))[0] if isdir(something): filepath = join(something, '__init__.py') else: filepath = something else: # suppose it's a module or package modname = something try: filepath = file_from_modpath(modname.split('.')) if filepath is None: self.set_current_module(modname) self.add_message('F0003', args=modname) continue except ImportError, ex: #if __debug__: # import traceback # traceback.print_exc() self.set_current_module(modname) msg = str(ex).replace(os.getcwd() + os.sep, '') self.add_message('F0001', args=msg) continue if self.config.files_output: reportfile = 'pylint_%s.%s' % (modname, self.reporter.extension) self.reporter.set_output(open(reportfile, 'w')) try: self.check_file(filepath, modname, checkers) except SyntaxError, ex: self.add_message('E0001', line=ex.lineno, args=ex.msg) # notify global end self.set_current_module('') for checker in rev_checkers: checker.close()
e524e87562c8d92f10c4684f7dd365b71d57878c /local1/tlutelli/issta_data/temp/all_python//python/2007_temp/2007/928/e524e87562c8d92f10c4684f7dd365b71d57878c/lint.py
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 2890, 16, 1390, 67, 280, 67, 6400, 4672, 3536, 5254, 6728, 1241, 30, 866, 279, 666, 434, 1390, 578, 4381, 628, 3675, 508, 18, 3536, 365, 18, 266, 7988, 18, 6702, 67, 2232, 2...
[ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1...
[ 1, 8585, 326, 22398, 316, 326, 981, 30, 1652, 866, 12, 2890, 16, 1390, 67, 280, 67, 6400, 4672, 3536, 5254, 6728, 1241, 30, 866, 279, 666, 434, 1390, 578, 4381, 628, 3675, 508, 18, 3536, 365, 18, 266, 7988, 18, 6702, 67, 2232, 2...