bugged stringlengths 4 228k | fixed stringlengths 0 96.3M | __index_level_0__ int64 0 481k |
|---|---|---|
def __init__(self, parent, cfg = None, clipboard = None): Utility.__init__( self, parent, _('Password Checker'), ( ( gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE ), ) ) | def __init__(self, parent, cfg = None, clipboard = None): Utility.__init__( self, parent, _('Password Checker'), ( ( gtk.STOCK_CLOSE, gtk.RESPONSE_CLOSE ), ) ) | 30,800 |
def __init__(self, parent, cfg, title, e = None): Utility.__init__( self, parent, title, ( ( gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL ), ( e is None and ui.STOCK_NEW_ENTRY or ui.STOCK_EDIT, gtk.RESPONSE_OK ) ) ) | def __init__(self, parent, cfg, title, e = None): Utility.__init__( self, parent, title, ( ( gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL ), ( e is None and ui.STOCK_NEW_ENTRY or ui.STOCK_EDIT, gtk.RESPONSE_OK ) ) ) | 30,801 |
def add_toolbar(self, toolbar, name, band): "Adds a toolbar" | def add_toolbar(self, toolbar, name, band): "Adds a toolbar" | 30,802 |
def __generate_header(self): "Generates a header" | def __generate_header(self): "Generates a header" | 30,803 |
def gconf_bind(self, key): GConfHandler.gconf_bind(self, key, self.__cb_gconf_get, self.__cb_gconf_set, "changed") | def gconf_bind(self, key): GConfHandler.gconf_bind(self, key, self.__cb_gconf_get, self.__cb_gconf_set, "changed") | 30,804 |
def __cb_buttonpress(self, widget, data): "Callback for handling mouse clicks" | def __cb_buttonpress(self, widget, data): "Callback for handling mouse clicks" | 30,805 |
def __cb_buttonpress(self, widget, data): "Callback for handling mouse clicks" | def __cb_buttonpress(self, widget, data): "Callback for handling mouse clicks" | 30,806 |
def export_data(self, entrystore, password): "Exports data to a data stream" | def export_data(self, entrystore, password): "Exports data to a data stream" | 30,807 |
def import_data(self, input, password): "Imports data from a data stream to an entrystore" | def import_data(self, input, password): "Imports data from a data stream to an entrystore" | 30,808 |
def save(self, entrystore, file, password = None): "Saves an entrystore to a file" | def save(self, entrystore, file, password = None): "Saves an entrystore to a file" | 30,809 |
def __cb_buttonpress(self, widget, data): "Callback for handling mouse clicks" | def __cb_buttonpress(self, widget, data): "Callback for handling mouse clicks" | 30,810 |
def _enableActions(self): enableAction = (len(self.model) > 0) self.miEdit.set_sensitive(enableAction) self.btnEdit.set_sensitive(enableAction) self.miDel.set_sensitive(enableAction) self.btnDel.set_sensitive(enableAction) if enableAction: identity = self._getIdentityFromSelection() features = transport.FEATURES[identi... | def _enableActions(self): enableAction = (len(self.model) > 0) self.miEdit.set_sensitive(enableAction) self.btnEdit.set_sensitive(enableAction) self.miDel.set_sensitive(enableAction) self.btnDel.set_sensitive(enableAction) identity = self._getIdentityFromSelection() if enableAction and identity: features = transport.FE... | 30,811 |
def _getIdentityFromSelection(self): selection = self.lvIdentities.get_selection() model, selected = selection.get_selected() return model.get_value(selected, 2) | def _getIdentityFromSelection(self): selection = self.lvIdentities.get_selection() if selection: model, selected = selection.get_selected() return model.get_value(selected, 2) | 30,812 |
def _pollEventQueue(self): if DEBUG: print 'Polling events from queue...' try: event, data = self.events.get_nowait() buf = self.txLog.get_buffer() buf.insert(buf.get_end_iter(), data) buf.insert(buf.get_end_iter(), '\n') except Queue.Empty: pass return True | def _pollEventQueue(self): try: event, data = self.events.get_nowait() buf = self.txLog.get_buffer() buf.insert(buf.get_end_iter(), data) buf.insert(buf.get_end_iter(), '\n') except Queue.Empty: pass return True | 30,813 |
def customEvent(self, e): t = e.type() if t == 10000: # sender thread ended work self.statusBar().message(self.__tr('Finished sending message')) msg = e.data() if msg is None: msg = self.__tr('Message has been sent.') QMessageBox.information(self, self.__tr('Information'), unicode(msg), QMessageBox.Ok) self.msgItemSele... | def customEvent(self, e): t = e.type() if t == 10000: # sender thread ended work self.statusBar().message(self.__tr('Finished sending message')) msg = e.data() if msg is None: msg = self.__tr('Message has been sent.') QMessageBox.information(self, self.__tr('Information'), unicode(msg, 'UTF-8', 'replace'), QMessageBox.... | 30,814 |
def notify(self, message): if message == 'item added': e = self.events.get_nowait() t = e.type() if t == 10000: # sender thread ended work self.statusBar().message(self.__tr('Finished sending message')) msg = e.data() if msg is None: msg = self.__tr('Message has been sent.') QMessageBox.information(self, self.__tr('Inf... | def notify(self, message): if message == 'item added': e = self.events.get_nowait() t = e.type() if t == 10000: # sender thread ended work self.statusBar().message(self.__tr('Finished sending message')) msg = e.data() if msg is None: msg = self.__tr('Message has been sent.') QMessageBox.information(self, self.__tr('Inf... | 30,815 |
def _getIdentityFromSelection(self): selection = self.lvIdentities.get_selection() if selection: model, selected = selection.get_selected() return model.get_value(selected, 2) | def _getIdentityFromSelection(self): selection = self.lvIdentities.get_selection() if not (None in selection.get_selected()): model, selected = selection.get_selected() return model.get_value(selected, 2) | 30,816 |
def _discoverWeblogs(self, *args): identity = self._getIdentityFromSelection() self.controller.discoverWeblogs(identity, self) | def _discoverWeblogs(self, *args): identity = self._getIdentityFromSelection() if identity: self.controller.discoverWeblogs(identity, self) | 30,817 |
def _initGui(self): monthStore = gtk.ListStore(str) # stupid hack for i in range(12): monthStore.append((datetime.date(2005, i + 1, 1).strftime('%B'), )) self.cbxMonth.set_model(monthStore) cell = gtk.CellRendererText() self.cbxMonth.pack_start(cell, True) self.cbxMonth.add_attribute(cell, 'text', 0) self.cbxMonth.set_... | def _initGui(self): monthStore = gtk.ListStore(str) # stupid hack for i in range(12): monthStr = datetime.date(2005, i + 1, 1).strftime('%B') enc = locale.getdefaultlocale()[1] monthStore.append((monthStr.decode(enc), )) self.cbxMonth.set_model(monthStore) cell = gtk.CellRendererText() self.cbxMonth.pack_start(cell, Tr... | 30,818 |
def _activateFeatures(self): model = self.cbxIdentity.get_model() identity = model.get_value(self.cbxIdentity.get_active_iter(), 1) features = transport.FEATURES[identity.transportType] self.edWeblogID.set_sensitive('blogID' in features) | def _activateFeatures(self): model = self.cbxIdentity.get_model() if len(model) > 0: identity = model.get_value(self.cbxIdentity.get_active_iter(), 1) features = transport.FEATURES[identity.transportType] self.edWeblogID.set_sensitive('blogID' in features) | 30,819 |
def on_frmEntry_delete_event(self, *args): gobject.source_remove(self.autosaveTimer) | def on_frmEntry_delete_event(self, *args): gobject.source_remove(self.autosaveTimer) | 30,820 |
def on_btnCancel_clicked(self, *args): gobject.source_remove(self.autosaveTimer) if self.isNew and self.entry: self.entry.destroySelf() self.window.destroy() | def on_btnCancel_clicked(self, *args): if self.autosaveTimer: gobject.source_remove(self.autosaveTimer) if self.isNew and self.entry: self.entry.destroySelf() self.window.destroy() | 30,821 |
def __init__(self, message, parent, name=None, modal=0, fl=0): MsgPreviewDialogImpl.__init__(self, parent, name, modal, fl) qApp.setOverrideCursor(QCursor(Qt.WaitCursor)) try: self.setCaption('%s - %s' % (self.__tr('Message preview'), unicode(message['title']))) if message['content-type'] == 'textile': body = textile.t... | def __init__(self, message, parent, name=None, modal=0, fl=0): MsgPreviewDialogImpl.__init__(self, parent, name, modal, fl) qApp.setOverrideCursor(QCursor(Qt.WaitCursor)) try: self.setCaption('%s - %s' % (self.__tr('Message preview'), unicode(message['title']))) if message['content-type'] == 'textile': body = textile.t... | 30,822 |
def __init__(self, message, parent, name=None, modal=0, fl=0): MsgPreviewDialogImpl.__init__(self, parent, name, modal, fl) qApp.setOverrideCursor(QCursor(Qt.WaitCursor)) try: self.setCaption('%s - %s' % (self.__tr('Message preview'), unicode(message['title']))) if message['content-type'] == 'textile': body = textile.t... | def __init__(self, message, parent, name=None, modal=0, fl=0): MsgPreviewDialogImpl.__init__(self, parent, name, modal, fl) qApp.setOverrideCursor(QCursor(Qt.WaitCursor)) try: self.setCaption('%s - %s' % (self.__tr('Message preview'), unicode(message['title']))) if message['content-type'] == 'textile': body = textile.t... | 30,823 |
def __init__(self, message, parent, name=None, modal=0, fl=0): MsgPreviewDialogImpl.__init__(self, parent, name, modal, fl) qApp.setOverrideCursor(QCursor(Qt.WaitCursor)) try: self.setCaption('%s - %s' % (self.__tr('Message previev'), unicode(message['title']))) if message['content-type'] == 'textile': body = textile.t... | def __init__(self, message, parent, name=None, modal=0, fl=0): MsgPreviewDialogImpl.__init__(self, parent, name, modal, fl) qApp.setOverrideCursor(QCursor(Qt.WaitCursor)) try: self.setCaption('%s - %s' % (self.__tr('Message preview'), unicode(message['title']))) if message['content-type'] == 'textile': body = textile.t... | 30,824 |
def postNew(self, blogId, entry, categories): if DEBUG: print 'started sending' s = self.getServerProxy() body = {} body['flNotOnHomePage'] = False body['title'] = entry.title.encode('utf-8') body['description'] = renderBodyAsXML(entry.body.encode('utf-8'), entry.bodyType) body['categories'] = [] for category in catego... | def postNew(self, blogId, entry, categories): if DEBUG: print 'started sending' s = self.getServerProxy() body = {} body['flNotOnHomePage'] = False body['title'] = entry.title.encode('utf-8') body['description'] = renderBodyAsXML(entry.body.encode('utf-8'), entry.bodyType) body['categories'] = [] for category in catego... | 30,825 |
def postModified(self, blogId, entryId, entry, categories): if DEBUG: print 'started sending modified entry' s = self.getServerProxy() body = {} body['flNotOnHomePage'] = False body['title'] = entry.title.encode('utf-8') body['description'] = renderBodyAsXML(entry.body.encode('utf-8'), entry.bodyType) body['categories'... | def postModified(self, blogId, entryId, entry, categories): if DEBUG: print 'started sending modified entry' s = self.getServerProxy() body = {} body['flNotOnHomePage'] = False body['title'] = entry.title.encode('utf-8') body['description'] = renderBodyAsXML(entry.body.encode('utf-8'), entry.bodyType) body['categories'... | 30,826 |
def scalarcons(self, args, size, extraTplArg=[]): common.inprint(self.tpl(size)) if len(extraTplArg) > 0: common.inprint("template<" + ", ".join(extraTplArg) + ">") #common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint(" : Gen... | def scalarcons(self, args, size, extraTplArg=[]): common.inprint(self.tpl(size)) if len(extraTplArg) > 0: common.inprint("template<" + ", ".join(extraTplArg) + ">") #common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint(" : Gen... | 30,827 |
def scalarcons(self, args, size, extraTplArg=[]): common.inprint(self.tpl(size)) if len(extraTplArg) > 0: common.inprint("template<" + ", ".join(extraTplArg) + ">") #common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint(" : Gen... | def scalarcons(self, args, size, extraTplArg=[]): common.inprint(self.tpl(size)) if len(extraTplArg) > 0: common.inprint("template<" + ", ".join(extraTplArg) + ">") #common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint(" : Gen... | 30,828 |
def copycons(self, args, size): other = args[0][1] | def copycons(self, args, size): other = args[0][1] | 30,829 |
def assign(self, fun, args, size): common.inprint(self.tpl(size) + "\n" + self.tplcls(size) + "&\n" + self.tplcls(size) + "::" + fun + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint("{") common.indent() other = args[0][1] if fun[-1] == "=" and fun[-2] in ["+", "-", "/", "*"]: common.inprint("*this =... | def assign(self, fun, args, size): common.inprint(self.tpl(size) + "\n" + self.tplcls(size) + "&\n" + self.tplcls(size) + "::" + fun + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint("{") common.indent() other = args[0][1] if fun[-1] == "=" and fun[-2] in ["+", "-", "/", "*"]: common.inprint("*this =... | 30,830 |
def assign(self, fun, args, size): common.inprint(self.tpl(size) + "\n" + self.tplcls(size) + "&\n" + self.tplcls(size) + "::" + fun + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint("{") common.indent() other = args[0][1] if fun[-1] == "=" and fun[-2] in ["+", "-", "/", "*"]: common.inprint("*this =... | def assign(self, fun, args, size): common.inprint(self.tpl(size) + "\n" + self.tplcls(size) + "&\n" + self.tplcls(size) + "::" + fun + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint("{") common.indent() other = args[0][1] if fun[-1] == "=" and fun[-2] in ["+", "-", "/", "*"]: common.inprint("*this =... | 30,831 |
def output(self, out, standalone=True): if standalone: self.output_header(out) self.output_textures(out) programs = {} test_nb = 0 for test, testcalls in self.tests: types = test[2] src_arg_types = zip(test[1], types[1:]) for i, call in enumerate(testcalls): testname = make_testname(src_arg_types, types, call.key(), te... | def output(self, out, standalone=True): if standalone: self.output_header(out) self.output_textures(out) programs = {} test_nb = 0 for test, testcalls in self.tests: types = test[2] src_arg_types = zip(test[1], types[1:]) for i, call in enumerate(testcalls): testname = make_testname(src_arg_types, types, call.key(), te... | 30,832 |
def output(self, out, standalone=True): if standalone: self.output_header(out) self.output_textures(out) test_nb = 0 for test, testcalls in self.tests: types = test[2] src_arg_types = zip(test[1], types[1:]) for i, call in enumerate(testcalls): testname = make_testname(src_arg_types, types, call.key(), test_nb) out.wri... | def output(self, out, standalone=True): if standalone: self.output_header(out) self.output_textures(out) test_nb = 0 for test, testcalls in self.tests: types = test[2] src_arg_types = zip(test[1], types[1:]) for i, call in enumerate(testcalls): testname = make_testname(src_arg_types, types, call.key(), test_nb) out.wri... | 30,833 |
def insert_into2(test, op): test.add_test(func((0.0,), op)) test.add_test(func((0.3, 0.5, 0.8, 0.9), op)) test.add_test(func((1 - 0.1, -1 + 0.1, 0.0), op)) test.add_test(func((-0.5, -0.9, -0.1), op)) test.add_test(func((0.5, 0.6, 0.9), op)) | def insert_into2(test, op): test.add_test(func((0.0,), op)) test.add_test(func((0.3, 0.5, 0.8, 0.9), op)) test.add_test(func((1 - 0.1, 0.0), op)) test.add_test(func((-1 + 0.1,), op, [], 0.09)) test.add_test(func((-0.5, -0.1), op)) test.add_test(func((0.5, 0.6, 0.9), op)) | 30,834 |
def length(a, types=[]): s = 0 for x in a: s += x*x result = sqrt(s) return shtest.make_test([result], [a], types) | def length(a): s = 0 for x in a: s += x*x result = sqrt(s) return shtest.make_test([result], [a], types) | 30,835 |
def length(a, types=[]): s = 0 for x in a: s += x*x result = sqrt(s) return shtest.make_test([result], [a], types) | def length(a, types=[]): s = 0 for x in a: s += x*x return [sqrt(s)] | 30,836 |
def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | def length_1(a): result = 0 for x in a: result += abs(x) return [result] test.add_test(length((0.2, 2.7, 3.23))) test.add_test(length((0.2, 2.7, -3.23))) test.add_test(length((0.2, -2.7, -3.23))) test.add_test(length((-0.2, -2.7, -3.23))) test.add_test(length((-0.2, -2.7, 3.23))) test.add_test(length((-0.2, 2.7, 3.23)... | 30,837 |
def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) def length_inf(a): result = a[0] for x in a: if abs(x... | 30,838 |
def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | 30,839 |
def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | 30,840 |
def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | 30,841 |
def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | def insert_into(test): test.add_test(length((1.0, 2.0, 3.0))) test.add_test(length((1.0, 2.0, -3.0))) test.add_test(length((1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, -3.0))) test.add_test(length((-1.0, -2.0, 3.0))) test.add_test(length((-1.0, 2.0, 3.0))) test.add_test(length((0.2, 2.7, 3.23))) test.add_test... | 30,842 |
def constructors(self, size = 0): common.inprint(self.tpl(size)) common.inprint(self.tplcls(size) + "::" + self.name + "()") common.inprint(" : ShGeneric<" + self.sizevar(size) + ", T>" + "(new ShVariableNode(Binding, " + self.sizevar(size) + "))") common.inprint("{") common.inprint("}") common.inprint("") | def constructors(self, size = 0): common.inprint(self.tpl(size)) common.inprint(self.tplcls(size) + "::" + self.name + "()") common.inprint(" : ShGeneric<" + self.sizevar(size) + ", T>" + "(new ShVariableNode(Binding, " + self.sizevar(size) + "))") common.inprint("{") common.inprint("}") common.inprint("") | 30,843 |
def constructors(self, size = 0): common.inprint(self.tpl(size)) common.inprint(self.tplcls(size) + "::" + self.name + "()") common.inprint(" : ShGeneric<" + self.sizevar(size) + ", T>" + "(new ShVariableNode(Binding, " + self.sizevar(size) + "))") common.inprint("{") common.inprint("}") common.inprint("") | def constructors(self, size = 0): common.inprint(self.tpl(size)) common.inprint(self.tplcls(size) + "::" + self.name + "()") common.inprint(" : ShGeneric<" + self.sizevar(size) + ", T>" + "(new ShVariableNode(Binding, " + self.sizevar(size) + "))") common.inprint("{") common.inprint("}") common.inprint("") | 30,844 |
def varsize(s): if s == 'v': return '3' if s == 's': return '1' return s | def varsize(s): if s == 'v': return '3' if s == 's': return '1' return s | 30,845 |
def varsize(s): if s == 'v': return '3' if s == 's': return '1' return s | def varsize(s): if s == 'v': return '3' if s == 's': return '1' return s | 30,846 |
def make_variable(arg, binding_type, value_type): if is_array(arg) and is_array(arg[0]): nrows = len(arg[0]) ncols = len(arg) return 'ShMatrix<' + str(nrows) + ', ' + str(ncols) + ', ' + binding_type + ', ' + value_type + '>' elif is_array(arg): size = len(arg) return 'ShAttrib<' + str(size) + ', ' + binding_type + ', ... | def make_variable(arg, binding_type, value_type, immediate=False): if is_array(arg) and is_array(arg[0]): nrows = len(arg[0]) ncols = len(arg) return 'ShMatrix<' + str(nrows) + ', ' + str(ncols) + ', ' + binding_type + ', ' + value_type + '>' elif is_array(arg): size = len(arg) return 'ShAttrib<' + str(size) + ', ' + b... | 30,847 |
def make_variable(arg, binding_type, value_type): if is_array(arg) and is_array(arg[0]): nrows = len(arg[0]) ncols = len(arg) return 'ShMatrix<' + str(nrows) + ', ' + str(ncols) + ', ' + binding_type + ', ' + value_type + '>' elif is_array(arg): size = len(arg) return 'ShAttrib<' + str(size) + ', ' + binding_type + ', ... | def make_variable(arg, binding_type, value_type): if is_array(arg) and is_array(arg[0]): ncols = len(arg[0]) nrows = len(arg) return 'ShMatrix<' + str(nrows) + ', ' + str(ncols) + ', ' + binding_type + ', ' + value_type + '>' elif is_array(arg): size = len(arg) return 'ShAttrib<' + str(size) + ', ' + binding_type + ', ... | 30,848 |
def init_scalar(indent, arg, argtype, varname): out = indent out += make_variable(arg, 'SH_CONST', argtype) + ' ' + varname out += '(' + argtype + '(' + str(arg) + '));\n' return out | def init_scalar(indent, arg, argtype, varname, immediate): out = indent out += make_variable(arg, 'SH_CONST', argtype) + ' ' + varname out += '(' + argtype + '(' + str(arg) + '));\n' return out | 30,849 |
def init_scalar(indent, arg, argtype, varname): out = indent out += make_variable(arg, 'SH_CONST', argtype) + ' ' + varname out += '(' + argtype + '(' + str(arg) + '));\n' return out | def init_scalar(indent, arg, argtype, varname): out = indent out += make_variable(arg, 'SH_CONST', argtype, immediate) + ' ' + varname out += '(' + argtype + '(' + str(arg) + '));\n' return out | 30,850 |
def init_variable(indent, arg, argtype, varname): if is_array(arg) and is_array(arg[0]): return init_matrix(indent, arg, argtype, varname) elif is_array(arg): return init_attrib(indent, arg, argtype, varname) else: return init_scalar(indent, arg, argtype, varname) | def init_variable(indent, arg, argtype, varname, immediate): if is_array(arg) and is_array(arg[0]): return init_matrix(indent, arg, argtype, varname) elif is_array(arg): return init_attrib(indent, arg, argtype, varname) else: return init_scalar(indent, arg, argtype, varname) | 30,851 |
def init_variable(indent, arg, argtype, varname): if is_array(arg) and is_array(arg[0]): return init_matrix(indent, arg, argtype, varname) elif is_array(arg): return init_attrib(indent, arg, argtype, varname) else: return init_scalar(indent, arg, argtype, varname) | def init_variable(indent, arg, argtype, varname): if is_array(arg) and is_array(arg[0]): return init_matrix(indent, arg, argtype, varname) elif is_array(arg): return init_attrib(indent, arg, argtype, varname) else: return init_scalar(indent, arg, argtype, varname) | 30,852 |
def init_inputs(indent, src_arg_types): out = '' i = 0 for arg, argtype in src_arg_types: varname = string.ascii_lowercase[i] out += init_variable(indent, arg, argtype, varname) i += 1; return out | def init_inputs(indent, src_arg_types): out = '' i = 0 for arg, argtype in src_arg_types: varname = string.ascii_lowercase[i] out += init_variable(indent, arg, argtype, varname, immediate) i += 1; return out | 30,853 |
def init_expected(indent, arg, argtype): out = '' varname = 'exp' out += init_variable(indent, arg, argtype, varname) return out | def init_expected(indent, arg, argtype, immediate=False): out = '' varname = 'exp' out += init_variable(indent, arg, argtype, varname) return out | 30,854 |
def init_expected(indent, arg, argtype): out = '' varname = 'exp' out += init_variable(indent, arg, argtype, varname) return out | def init_expected(indent, arg, argtype): out = '' varname = 'exp' out += init_variable(indent, arg, argtype, varname, immediate) return out | 30,855 |
def output(self, out): self.output_header(out) test_nb = 0 for test, testcalls in self.tests: types = test[2] src_arg_types = zip(test[1], types[1:]) for i, call in enumerate(testcalls): testname = make_testname(src_arg_types, types, call.key()) out.write(' { // ' + testname + '\n') out.write(init_inputs(' ', src_a... | def output(self, out): self.output_header(out) test_nb = 0 for test, testcalls in self.tests: types = test[2] src_arg_types = zip(test[1], types[1:]) for i, call in enumerate(testcalls): testname = make_testname(src_arg_types, types, call.key()) out.write(' { // ' + testname + '\n') out.write(init_inputs(' ', src_a... | 30,856 |
def output(self, out): self.output_header(out) test_nb = 0 for test, testcalls in self.tests: types = test[2] src_arg_types = zip(test[1], types[1:]) for i, call in enumerate(testcalls): testname = make_testname(src_arg_types, types, call.key()) out.write(' { // ' + testname + '\n') out.write(init_inputs(' ', src_a... | def output(self, out): self.output_header(out) test_nb = 0 for test, testcalls in self.tests: types = test[2] src_arg_types = zip(test[1], types[1:]) for i, call in enumerate(testcalls): testname = make_testname(src_arg_types, types, call.key()) out.write(' { // ' + testname + '\n') out.write(init_inputs(' ', src_a... | 30,857 |
def scalarcons(self, args, size, extraTplArg=[]): common.inprint(self.tpl(size)) if len(extraTplArg) > 0: common.inprint("template<" + ", ".join(extraTplArg) + ">") common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint(" : ShGe... | def scalarcons(self, args, size, extraTplArg=[]): common.inprint(self.tpl(size)) if len(extraTplArg) > 0: common.inprint("template<" + ", ".join(extraTplArg) + ">") common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint(" : ShGe... | 30,858 |
def scalarcons(self, args, size, extraTplArg=[]): common.inprint(self.tpl(size)) if len(extraTplArg) > 0: common.inprint("template<" + ", ".join(extraTplArg) + ">") common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint(" : ShGe... | def scalarcons(self, args, size, extraTplArg=[]): common.inprint(self.tpl(size)) if len(extraTplArg) > 0: common.inprint("template<" + ", ".join(extraTplArg) + ">") common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "(" + ', '.join([' '.join(x) for x in args]) + ")") common.inprint(" : ShGe... | 30,859 |
def constructors(self, size = 0): common.inprint(self.tpl(size)) #common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "()") common.inprint(" : Generic<" + self.sizevar(size) + ", T>" + "(new VariableNode(Binding, " + self.sizevar(size) + ", StorageTypeInfo<T>::value_type, Semantic))") common... | def constructors(self, size = 0): common.inprint(self.tpl(size)) #common.inprint("inline") common.inprint(self.tplcls(size) + "::" + self.name + "()") common.inprint(" : Generic<" + self.sizevar(size) + ", T>" + "(new VariableNode(Binding, " + self.sizevar(size) + ", StorageTypeInfo<T>::value_type, Semantic))") common... | 30,860 |
def atan2_test(p, q, types=[]): result = [math.atan2(b, a) for (a, b) in common.upzip(p, q)] return shtest.make_test(result, [p, q], types) | def atan2_test(p, q, types=[], epsilon=0): result = [math.atan2(b, a) for (a, b) in common.upzip(p, q)] return shtest.make_test(result, [p, q], types) | 30,861 |
def atan2_test(p, q, types=[]): result = [math.atan2(b, a) for (a, b) in common.upzip(p, q)] return shtest.make_test(result, [p, q], types) | def atan2_test(p, q, types=[]): result = [math.atan2(b, a) for (a, b) in common.upzip(p, q)] return shtest.make_test(result, [p, q], types, epsilon) | 30,862 |
def insert_into5(test): test.add_test(atan2_test((1.0, 1.0, 1.0, 1.0), (0.0, 1.0, 2.0, 3.0))) test.add_test(atan2_test((0.5, 1.5, 3.0, 50.0), (0.0, 1.0, 2.0, 3.0))) test.add_test(atan2_test((1.0, 1.0, 1.0, 1.0), (0.3, 0.5, 0.8, 0.9))) test.add_test(atan2_test((1.0, 1.0, 1.0), (math.pi, -math.pi, 0.0))) #test.add_test(a... | def insert_into5(test): test.add_test(atan2_test((1.0, 1.0, 1.0, 1.0), (0.0, 1.0, 2.0, 3.0))) test.add_test(atan2_test((0.5, 1.5, 3.0, 50.0), (0.0, 1.0, 2.0, 3.0))) test.add_test(atan2_test((1.0, 1.0, 1.0, 1.0), (0.3, 0.5, 0.8, 0.9))) test.add_test(atan2_test((1.0, 1.0, 1.0), (math.pi, -math.pi, 0.0))) #test.add_test(a... | 30,863 |
def __str__(self): # @todo type move this into test.hpp or test.cpp r = " " + self.textype + " " + self.name + ";\n"; r += " {\n" r += " ShImage image;\n" r += " image.load_PNG(\"" + self.filename + "\");\n" r += " " + self.name + ".size(image.width(), image.height());\n" r += " " + self.name + ".... | def __str__(self): # @todo type move this into test.hpp or test.cpp r = " " + self.textype + " " + self.name + ";\n"; r += " {\n" r += " ShImage image;\n" r += " ShUtil::load_PNG(image, \"" + self.filename + "\");\n" r += " " + self.name + ".size(image.width(), image.height());\n" r += " " + self.... | 30,864 |
def getChannelname(self): return self._channelname | def getChannelname(self): return self._channelname | 30,865 |
def addMessage(self, text, from_, to=""): """Formats a message in a pretty way with the given arguments. | def addMessage(self, text, from_, to=""): """Formats a message in a pretty way with the given arguments. | 30,866 |
def text_command(self,cmdstring,window): if not cmdstring: return # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | def text_command(self,cmdstring,window): if not cmdstring: return # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | 30,867 |
def text_command(self,cmdstring,window): if not cmdstring: return # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | def text_command(self,cmdstring,window): if not cmdstring: return # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | 30,868 |
def text_command(self,cmdstring,window): if not cmdstring: return # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | def text_command(self,cmdstring,window): if not cmdstring: return # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | 30,869 |
def create_menu(self): menu_file = wx.Menu() menu_file.Append(ID_MENU_FILE_ABOUT, "&About", "About %s" % (circe_globals.APPNAME)) menu_file.AppendSeparator() menu_file.Append(ID_MENU_FILE_EXIT, "E&xit", "Exit %s" % (circe_globals.APPNAME)) menu_switchbar = wx.Menu() menu_switchbar.Append(ID_MENU_VIEW_SWITCHBAR_ALEFT, ... | def create_menu(self): menu_file = wx.Menu() menu_file.Append(ID_MENU_FILE_ABOUT, "&About", "About %s" % (circe_globals.APPNAME)) menu_file.AppendSeparator() menu_file.Append(ID_MENU_FILE_EXIT, "E&xit", "Exit %s" % (circe_globals.APPNAME)) menu_switchbar = wx.Menu() menu_switchbar.Append(ID_MENU_VIEW_SWITCHBAR_ALEFT, ... | 30,870 |
def create_menu(self): menu_file = wx.Menu() menu_file.Append(ID_MENU_FILE_ABOUT, "&About", "About %s" % (circe_globals.APPNAME)) menu_file.AppendSeparator() menu_file.Append(ID_MENU_FILE_EXIT, "E&xit", "Exit %s" % (circe_globals.APPNAME)) menu_switchbar = wx.Menu() menu_switchbar.Append(ID_MENU_VIEW_SWITCHBAR_ALEFT, ... | def create_menu(self): menu_file = wx.Menu() menu_file.Append(ID_MENU_FILE_ABOUT, "&About", "About %s" % (circe_globals.APPNAME)) menu_file.AppendSeparator() menu_file.Append(ID_MENU_FILE_EXIT, "E&xit", "Exit %s" % (circe_globals.APPNAME)) menu_switchbar = wx.Menu() menu_switchbar.Append(ID_MENU_VIEW_SWITCHBAR_ALEFT, ... | 30,871 |
def TextCommand(self,cmdstring,window): if not cmdstring: raise "Empty command" | def TextCommand(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,872 |
def TextCommand(self,cmdstring,window): if not cmdstring: raise "Empty command" | def TextCommand(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,873 |
def TextCommand(self,cmdstring,window): if not cmdstring: raise "Empty command" | def TextCommand(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,874 |
def text_command(self,cmdstring,window): if not cmdstring: return # is raising a exception necessary? # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | def text_command(self,cmdstring,window): if not cmdstring: return # is raising a exception necessary? # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | 30,875 |
def check_events(self): """Redirects all received events to the correct windows.""" # Print events and display them in the rigth windows. for e in self.get_events(): | def check_events(self): """Redirects all received events to the correct windows.""" # Print events and display them in the rigth windows. for e in self.get_events(): | 30,876 |
def check_events(self): """Redirects all received events to the correct windows.""" # Print events and display them in the rigth windows. for e in self.get_events(): | def check_events(self): """Redirects all received events to the correct windows.""" # Print events and display them in the rigth windows. for e in self.get_events(): | 30,877 |
def check_events(self): """Redirects all received events to the correct windows.""" # Print events and display them in the rigth windows. for e in self.get_events(): | def check_events(self): """Redirects all received events to the correct windows.""" # Print events and display them in the rigth windows. for e in self.get_events(): | 30,878 |
def bind_events(self): self.panel_switchbar.bind_click(self.evt_switchbar_event) self.panel_windowarea.bind_add(self.evt_windowarea_addwindow) self.panel_windowarea.bind_del(self.evt_windowarea_delwindow) self.panel_windowarea.bind_show(self.evt_windowarea_showwindow) self.panel_windowarea.bind_set_caption(self.evt_win... | defself.Bind(wx.EVT_CLOSE, self.evt_window_del) bind_events(self):self.Bind(wx.EVT_CLOSE, self.evt_window_del) self.panel_switchbar.bind_click(self.evt_switchbar_event)self.Bind(wx.EVT_CLOSE, self.evt_window_del) self.panel_windowarea.bind_add(self.evt_windowarea_addwindow)self.Bind(wx.EVT_CLOSE, self.evt_window_del... | 30,879 |
def __getitem__(self, k): try: return self.config.get(self.section, k) except: try: v = DEFAULTS[k] self.__setitem__(k,v) return v except: raise KeyError, k | def __getitem__(self, k): try: return self.config.get(self.section, k) except (ValueError, KeyError): try: v = DEFAULTS[k] self.__setitem__(k,v) return v except (ValueError, KeyError): raise KeyError, k | 30,880 |
def autocomplete(self): """Autocompletes the current input""" value = self.txt_edit.GetValue() if not value: # ignore if nothing typed return get_channelname = getattr(self, "get_channelname", None) if not get_channelname: # ignore if cannot get channel name return channel = get_channelname() # get the channel name if... | def autocomplete(self): """Autocompletes the current input""" value = self.txt_edit.GetValue() if not value: # ignore if nothing typed return get_channelname = getattr(self, "get_channelname", None) if not get_channelname: # ignore if cannot get channel name return channel = get_channelname() # get the channel name if... | 30,881 |
def text_command(self,cmdstring,window): if not cmdstring: return # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | def text_command(self,cmdstring,window): if not cmdstring: return # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | 30,882 |
def text_command(self,cmdstring,window): if not cmdstring: return # in a debug window, do nothing if hasattr(window, "get_channelname") and \ window.get_channelname() == "debug": return | defwindow.server_event("%s has joined %s." % (self.connection.get_nickname(), params[0])) text_command(self,cmdstring,window):window.server_event("%s has joined %s." % (self.connection.get_nickname(), params[0])) ifwindow.server_event("%s has joined %s." % (self.connection.get_nickname(), params[0])) notwindow.server_e... | 30,883 |
def cmd_names(self,window,server,params): if len(params) >= 0: if "," in params[0]: server.connection.names(params[0].split(",")) else: server.connection.names(params) else: server.connection.names(window.get_channelname()) | def cmd_names(self,window,server,params): if len(params) > 0: if params[0].find(",") != -1: server.connection.names(params[0].split(",")) else: server.connection.names(params) else: server.connection.names(window.get_channelname()) | 30,884 |
def channel_closed(self, channel): if channel in self.channels: del self.channels[self.channels.index(channel)] else: raise "channel_closed called for unknown channel!" | def channel_closed(self, channel): if channel in self.channels: del self.channels[self.channels.index(channel)] else: raise "channel_closed called for unknown channel!" | 30,885 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,886 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,887 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,888 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,889 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,890 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,891 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,892 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | defelif cmd == "ctcp": pass text_command(self,cmdstring,window):elif cmd == "ctcp": pass ifelif cmd == "ctcp": pass notelif cmd == "ctcp": pass cmdstring:elif cmd == "ctcp": pass raiseelif cmd == "ctcp": pass "Emptyelif cmd == "ctcp": pass command" | 30,893 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,894 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,895 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,896 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,897 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,898 |
def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | def text_command(self,cmdstring,window): if not cmdstring: raise "Empty command" | 30,899 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.