def checkOtherDetailsValues(oList): test.compare(findObject(":Other Details.currency_QComboBox").currentText, oList[0]) test.compare(findObject(":Other Details.amount_QLineEdit").text, oList[1]) if(oList[2] == "1/2"): test.compare(findObject(":Other Details.dateClosed_QLineEdit").text, "2010-07-26") test.compare(findObject(":Other Details.nextStep_QLineEdit").text, oList[3]) test.compare(findObject(":Other Details.probability_QLineEdit").text, oList[4])
def createPublicLink(self, context, resource, password='', permissions=''): radioObjectName = '' if permissions: radioObjectName = self.getRadioObjectForPermssion(permissions) test.compare( str(squish.waitForObjectExists(self.ITEM_TO_SHARE).text), resource.replace(context.userData['clientSyncPathUser1'], ''), ) if radioObjectName: test.compare(str(squish.waitForObjectExists(radioObjectName).text), permissions) squish.clickButton(squish.waitForObject(radioObjectName)) if password: squish.clickButton(squish.waitForObject(self.PASSWORD_CHECKBOX)) squish.mouseClick( squish.waitForObject(self.PASSWORD_CHECKBOX), 0, 0, squish.Qt.NoModifier, squish.Qt.LeftButton, ) squish.type( squish.waitForObject(self.PASSWORD_CHECKBOX), password, ) squish.clickButton(squish.waitForObject(self.CREATE_SHARE_BUTTON)) squish.waitFor(lambda: (squish.waitForObject( names.linkShares_0_0_QModelIndex).displayText == "Public link"))
def main(image_paths, threaded=True): if threaded: desc = [] # Create a pool of processes. By default, one is created for each CPU in your machine. with concurrent.futures.ThreadPoolExecutor(max_workers=8) as executor: for d in executor.map(process, image_paths): desc += d else: desc = [] for image in image_paths: desc += process(image) for i in desc: if isinstance(i, dict): for k, v in i.items(): print('{}: {}'.format(k, v)) print() else: print(i) test = [] for i in desc: if isinstance(i, dict): test.append(i) # dirty testing from test import compare, actual compare(test, actual)
def compare(condition1, condition2, text): """ calls Squish's compare but switch back to main app. See "fail" in this class, since compare's fail behavior is problematic and explained there. """ switch_to_main_app() test.compare(condition1, condition2, text)
def removeLead(firstName): clickTab(waitForObject(":SugarCRM Client: admin@SugarCRM on localhost.qt_tabwidget_tabbar_QTabBar"), "Leads") type(waitForObject(":Form.searchLE_QLineEdit_3"), firstName) mouseClick((":Form.leadsTV_Akonadi::EntityTreeView"), 62, 8, 0, Qt.LeftButton) clickButton(waitForObject(":Form.Remove Lead_QPushButton")) clickButton(waitForObject(":SugarClient - Delete Lead.Yes_QPushButton")) clickButton(waitForObject(":Form.Clear_QToolButton_3")) type(waitForObject(":Form.searchLE_QLineEdit_3"), firstName) treeView = waitForObject(":Form.leadsTV_Akonadi::EntityTreeView") model = treeView.model() count = model.rowCount() test.compare(count, 0)
def removeAccount( accountName ): clickTab(waitForObject(":SugarCRM Client: admin@SugarCRM on localhost.qt_tabwidget_tabbar_QTabBar"), "Accounts") type(waitForObject(":Page.searchLE_QLineEdit"), accountName) waitForObjectItem(":Page.treeView_Akonadi::EntityTreeView", "admin") clickButton(waitForObject(":Page.Remove_QPushButton")) clickButton(waitForObject(":Delete record.Yes_QPushButton")) clickButton(waitForObject(":Page.Clear_QToolButton")) type(waitForObject(":Page.searchLE_QLineEdit"), accountName) treeView = waitForObject(":Page.treeView_Akonadi::EntityTreeView") model = treeView.model() count = model.rowCount() test.compare(count, 0)
def checkOtherDetailsValues(oList): test.compare( findObject(":Other Details.currency_QComboBox").currentText, oList[0]) test.compare(findObject(":Other Details.amount_QLineEdit").text, oList[1]) if (oList[2] == "1/2"): test.compare( findObject(":Other Details.dateClosed_QLineEdit").text, "2010-07-26") test.compare( findObject(":Other Details.nextStep_QLineEdit").text, oList[3]) test.compare( findObject(":Other Details.probability_QLineEdit").text, oList[4])
def removeContact(firstName): clickTab(waitForObject(":SugarCRM Client: admin@SugarCRM on localhost.qt_tabwidget_tabbar_QTabBar"), "Contacts") type(waitForObject(":Contacts.searchLE_QLineEdit"), firstName) mouseClick((":Contacts.contactsTV_Akonadi::EntityTreeView"), 20, 42, 0, Qt.LeftButton) clickButton(waitForObject(":Contacts.Remove Contact_QPushButton")) clickButton(waitForObject(":SugarClient - Delete Contact.Yes_QPushButton")) clickButton(waitForObject(":Contacts.Clear_QToolButton")) type(waitForObject(":Contacts.searchLE_QLineEdit"), firstName) treeView = waitForObject(":Contacts.contactsTV_Akonadi::EntityTreeView") model = treeView.model() count = model.rowCount() test.compare(count, 0)
def removeOpportunity(opportunityName): clickTab(waitForObject(":SugarCRM Client: admin@SugarCRM on localhost.qt_tabwidget_tabbar_QTabBar"), "Opportunities") type(waitForObject(":Form.searchLE_QLineEdit_2"), opportunityName) mouseClick(waitForObject(":Form.opportunitiesTV_Akonadi::EntityTreeView"), 135, 9, 0, Qt.LeftButton) clickButton(waitForObject(":Form.Remove Opportunity_QPushButton")) clickButton(waitForObject(":SugarClient - Delete Opportunity.Yes_QPushButton")) clickButton(waitForObject(":Form.Clear_QToolButton_2")) type(waitForObject(":Form.searchLE_QLineEdit_2"), opportunityName) treeView = waitForObject(":Form.opportunitiesTV_Akonadi::EntityTreeView") model = treeView.model() count = model.rowCount() test.compare(count, 0)
def removeContact(firstName): clickTab(waitForObject(":SugarCRM Client: admin@SugarCRM on localhost.qt_tabwidget_tabbar_QTabBar"), "Contacts") type(waitForObject(":Contacts.searchLE_QLineEdit"), firstName) mouseClick((":Contacts.contactsTV_Akonadi::EntityTreeView"), 20, 42, 0, Qt.LeftButton) clickButton(waitForObject(":Contacts.Remove Contact_QPushButton")) clickButton(waitForObject(":Delete Contact.Yes_QPushButton")) clickButton(waitForObject(":Contacts.Clear_QToolButton")) type(waitForObject(":Contacts.searchLE_QLineEdit"), firstName) treeView = waitForObject(":Contacts.contactsTV_Akonadi::EntityTreeView") model = treeView.model() count = model.rowCount() test.compare(count, 0)
def removeCampaign(name): clickTab(waitForObject(":SugarCRM Client: admin@SugarCRM on localhost.qt_tabwidget_tabbar_QTabBar"), "Campaigns") type(waitForObject(":Page.searchLE_QLineEdit_2"), name) mouseClick((":Page.treeView_Akonadi::EntityTreeView_2"), 67, 5, 0, Qt.LeftButton) clickButton(waitForObject(":Page.Remove_QPushButton_2")) mouseClick(waitForObject(":Delete record_QMessageBox"), 94, 59, 0, Qt.LeftButton) clickButton(waitForObject(":Delete record.Yes_QPushButton")) clickButton(waitForObject(":Page.Clear_QToolButton_2")) type(waitForObject(":Page.searchLE_QLineEdit_2"), name) treeView = waitForObject(":Page.treeView_Akonadi::EntityTreeView_2") model = treeView.model() count = model.rowCount() test.compare(count, 0)
def removeAccount(accountName): clickTab( waitForObject( ":SugarCRM Client: admin@SugarCRM on localhost.qt_tabwidget_tabbar_QTabBar" ), "Accounts") type(waitForObject(":Page.searchLE_QLineEdit"), accountName) waitForObjectItem(":Page.treeView_Akonadi::EntityTreeView", "admin") clickButton(waitForObject(":Page.Remove_QPushButton")) clickButton(waitForObject(":Delete record.Yes_QPushButton")) clickButton(waitForObject(":Page.Clear_QToolButton")) type(waitForObject(":Page.searchLE_QLineEdit"), accountName) treeView = waitForObject(":Page.treeView_Akonadi::EntityTreeView") model = treeView.model() count = model.rowCount() test.compare(count, 0)
def removeOpportunity(opportunityName): clickTab( waitForObject( ":SugarCRM Client: admin@SugarCRM on localhost.qt_tabwidget_tabbar_QTabBar" ), "Opportunities") type(waitForObject(":Form.searchLE_QLineEdit_2"), opportunityName) mouseClick(waitForObject(":Form.opportunitiesTV_Akonadi::EntityTreeView"), 135, 9, 0, Qt.LeftButton) clickButton(waitForObject(":Form.Remove Opportunity_QPushButton")) clickButton(waitForObject(":Delete Opportunity.Yes_QPushButton")) clickButton(waitForObject(":Form.Clear_QToolButton_2")) type(waitForObject(":Form.searchLE_QLineEdit_2"), opportunityName) treeView = waitForObject(":Form.opportunitiesTV_Akonadi::EntityTreeView") model = treeView.model() count = model.rowCount() test.compare(count, 0)
def removeLead(firstName): clickTab( waitForObject( ":SugarCRM Client: admin@SugarCRM on localhost.qt_tabwidget_tabbar_QTabBar" ), "Leads") type(waitForObject(":Form.searchLE_QLineEdit_3"), firstName) mouseClick((":Form.leadsTV_Akonadi::EntityTreeView"), 62, 8, 0, Qt.LeftButton) clickButton(waitForObject(":Form.Remove Lead_QPushButton")) clickButton(waitForObject(":Delete Lead.Yes_QPushButton")) clickButton(waitForObject(":Form.Clear_QToolButton_3")) type(waitForObject(":Form.searchLE_QLineEdit_3"), firstName) treeView = waitForObject(":Form.leadsTV_Akonadi::EntityTreeView") model = treeView.model() count = model.rowCount() test.compare(count, 0)
def selectSyncFolder(self, context): clientDetails = getClientDetails(context) try: squish.clickButton(squish.waitForObject(self.ERROR_OK_BUTTON)) except LookupError: pass squish.clickButton(squish.waitForObject(self.SELECT_LOCAL_FOLDER)) squish.mouseClick(squish.waitForObject(self.DIRECTORY_NAME_BOX)) squish.type( squish.waitForObject(self.DIRECTORY_NAME_BOX), clientDetails['localfolder'] ) squish.clickButton(squish.waitForObject(self.CHOOSE_BUTTON)) test.compare( str(squish.waitForObjectExists(self.SELECT_LOCAL_FOLDER).text), self.sanitizeFolderPath(clientDetails['localfolder']), )
def main(): trainx, trainy, testx, testy = load_data.load_data() w, y1 = calc_hypothesis(trainx, trainy) y1 = np.reshape(y1, (np.shape(y1)[0], )) # train_accuracy = test.accuracy(y1, trainy) # print(train_accuracy) testx, _ = convert(testx) n = len(testx) y_dash = [] for i in range(n): y_dash.append(np.matmul(testx[i], w)) test.compare(y_dash, testy) test_accuracy = test.accuracy(y_dash, testy) print(test_accuracy)
def setExpirationDate(self, context, publicLinkName, resource): test.compare( str(squish.waitForObjectExists(self.ITEM_TO_SHARE).text), resource, ) test.compare( str(squish.waitForObjectExists(self.PUBLIC_LINK_NAME).text), publicLinkName, ) expDate = [] for row in context.table: if row[0] == 'expireDate': expDate = datetime.datetime.strptime(row[1], '%Y-%m-%d') expYear = expDate.year - 2000 squish.mouseClick( squish.waitForObject(self.EXPIRATION_DATE_FIELD), 0, 0, squish.Qt.NoModifier, squish.Qt.LeftButton, ) squish.nativeType("<Delete>") squish.nativeType("<Delete>") squish.nativeType(expDate.month) squish.nativeType(expDate.day) squish.nativeType(expYear) squish.nativeType("<Return>") squish.testSettings.silentVerifications = True squish.waitFor(lambda: (test.xvp( "publicLinkExpirationProgressIndicatorInvisible"))) waitFor(lambda: (test.vp("publicLinkExpirationProgressIndicatorInvisible"))) squish.testSettings.silentVerifications = False test.compare( str( squish.waitForObjectExists( self.EXPIRATION_DATE_FIELD).displayText), str(expDate.month) + "/" + str(expDate.day) + "/" + str(expYear), )
def checkOtherDetailsValues(oList): test.compare( findObject(":Other Details.status_QComboBox").currentText, oList[0]) test.compare( findObject(":Other Details.statusDescription_QTextEdit").plainText, oList[1]) test.compare( findObject(":Other Details.opportunityAmount_QLineEdit").text, oList[2]) test.compare( findObject(":Other Details.phoneWork_QLineEdit").text, oList[3]) test.compare( findObject(":Other Details.phoneMobile_QLineEdit").text, oList[4]) test.compare( findObject(":Other Details.phoneHome_QLineEdit").text, oList[5]) test.compare( findObject(":Other Details.phoneOther_QLineEdit").text, oList[6]) test.compare( findObject(":Other Details.phoneFax_QLineEdit_2").text, oList[7]) if (oList[8] == "true"): test.compare( findObject(":Other Details.doNotCall_QCheckBox_2").checked, True) else: test.compare( findObject(":Other Details.doNotCall_QCheckBox_2").checked, False) test.compare( findObject(":Other Details.email1_QLineEdit_2").text, oList[9]) test.compare(findObject(":Other Details.email2_QLineEdit").text, oList[10])
def checkDetailsValues(dList): test.compare(findObject(":Details.salutation_QComboBox_2").currentText, dList[0]) test.compare(findObject(":Details.firstName_QLineEdit_2").text, dList[1]) test.compare(findObject(":Details.lastName_QLineEdit_2").text, dList[2]) test.compare(findObject(":Details.title_QLineEdit_2").text, dList[3]) test.compare(findObject(":Details.department_QLineEdit_2").text, dList[4]) test.compare(findObject(":Details.accountName_QComboBox_2").currentText, dList[5]) test.compare(findObject(":Details.leadSource_QComboBox_3").currentText, dList[6]) test.compare(findObject(":Details.campaign_QComboBox").currentText, dList[7]) test.compare(findObject(":Details.assignedTo_QComboBox").currentText, dList[8]) test.compare(findObject(":Details.reportsTo_QComboBox").currentText, dList[9]) test.compare(findObject(":Details.primaryEmail_QLineEdit").text, dList[10])
def checkDetailsValues(dList): test.compare( findObject(":Details.leadSource_QComboBox_2").currentText, dList[0]) test.compare( findObject(":Details.leadSourceDescription_QTextEdit").plainText, dList[1]) test.compare( findObject(":Details.campaignName_QComboBox_3").currentText, dList[2]) test.compare(findObject(":Details.referedBy_QLineEdit").text, dList[3]) test.compare( findObject(":Details.salutation_QComboBox").currentText, dList[4]) test.compare(findObject(":Details.firstName_QLineEdit").text, dList[5]) test.compare(findObject(":Details.lastName_QLineEdit").text, dList[6]) if (dList[7] == "2/2"): test.compare( findObject(":Details.birthdate_QLineEdit_2").text, "2010-08-02") test.compare(findObject(":Details.accountName_QLineEdit").text, dList[8]) test.compare(findObject(":Details.title_QLineEdit").text, dList[9]) test.compare(findObject(":Details.department_QLineEdit").text, dList[10]) test.compare( findObject(":Details.assignedUserName_QComboBox_3").currentText, dList[11])
def checkDescriptionValue(description): test.compare(findObject(":Description:.description_QTextEdit_2").plainText, description)
def main(pathname, filename, chords=False): # SCORE = cv2.imread(pathname) # # Display score # cv2.imshow('score', SCORE) # # Play metronome beat # # Record # print ('Press R to begin recording and Ctrl+C to stop it') # while True: # KEY = cv2.waitKey(1) & 0xFF # if KEY == ord('r'): # import rec_unlimited # rec_unlimited.main(filename) # break # if KEY == 27: # break # cv2.destroyAllWindows() import test # Read reference audio file and detect tempo y_ref, sr_ref = librosa.load( '/Users/mengyuyang/Desktop/First Level/triplets.mp3') ref_tempo = librosa.beat.tempo(y=y_ref, sr=sr_ref) # Read recording audio file and detect tempo y_rec, sr_rec = librosa.load('/Users/mengyuyang/Desktop/First Level/' + filename + '.wav') rec_tempo = librosa.beat.tempo(y=y_rec, sr=sr_rec, start_bpm=ref_tempo) # Normalize tempo of the two audio files by scaling recording file down to reference's tempo scale = ref_tempo / rec_tempo # Convert reference recording into data for analysis and plot for visualization ref_peak, ref_chroma = test.read(y_ref, sr_ref) #test.plot(ref_chroma, '/Users/mengyuyang/Desktop/First Level/triplets.mp3') # Convert recording into data for analysis and plot for visualization rec_peak, rec_chroma = test.read(y_rec, sr_rec) #test.plot(rec_chroma, '/Users/mengyuyang/Desktop/First Level/recording.wav') # Generate note and chord templates note_template, note_label = test.note_template() # Generate comparable dictionary containing onset times and names for chords/notes reference = test.analyze(ref_peak, ref_chroma, note_template, note_label) recording = test.analyze(rec_peak, rec_chroma, note_template, note_label, scale=scale) print(reference) # print (len(reference)) print(recording) # print (len(recording)) # Compare the two dictionaries and give score #score = test.compare(reference,recording) score = test.compare(reference, recording) if score > 65: message = 'You pass!' else: message = 'Please try the exercise again.' print('Your grade is', score, 'out of 100.', message) test.plot(rec_chroma, '/Users/mengyuyang/Desktop/First Level/recording3.wav')
def checkDetailsValues(dList): test.compare(findObject(":Details.name_QLineEdit").text, dList[0]) test.compare(findObject(":Details.website_QLineEdit").text, dList[1]) test.compare(findObject(":Details.tyckerSymbol_QLineEdit").text, dList[2]) test.compare( findObject(":Details.parentName_QComboBox").currentText, dList[3]) test.compare(findObject(":Details.ownership_QLineEdit").text, dList[4]) test.compare( findObject(":Details.industry_QComboBox").currentText, dList[5]) test.compare( findObject(":Details.accountType_QComboBox").currentText, dList[6]) test.compare( findObject(":Details.campaignName_QComboBox").currentText, dList[7]) test.compare( findObject(":Details.assignedUserName_QComboBox").currentText, dList[8])
def checkDetailsValues(dList): test.compare(findObject(":Details.name_QLineEdit_2").text, dList[0]) test.compare(findObject(":Details.accountName_QComboBox").currentText, dList[1]) test.compare(findObject(":Details.opportunityType_QComboBox").currentText, dList[2]) test.compare(findObject(":Details.leadSource_QComboBox").currentText, dList[3]) test.compare(findObject(":Details.campaignName_QComboBox_2").currentText, dList[4]) test.compare(findObject(":Details.salesStage_QComboBox").currentText, dList[5]) test.compare(findObject(":Details.assignedUserName_QComboBox_2").currentText, dList[6])
def checkAddressesValues(aList): test.compare(findObject(":Addresses.primaryAddressStreet_QLineEdit").text, aList[0]) test.compare(findObject(":Addresses.primaryAddressCity_QLineEdit").text, aList[1]) test.compare(findObject(":Addresses.primaryAddressState_QLineEdit").text, aList[2]) test.compare(findObject(":Addresses.primaryAddressPostalcode_QLineEdit").text, aList[3]) test.compare(findObject(":Addresses.primaryAddressCountry_QLineEdit").text, aList[4]) test.compare(findObject(":Addresses.altAddressStreet_QLineEdit").text, aList[5]) test.compare(findObject(":Addresses.altAddressCity_QLineEdit").text, aList[6]) test.compare(findObject(":Addresses.altAddressState_QLineEdit").text, aList[7]) test.compare(findObject(":Addresses.altAddressPostalcode_QLineEdit").text, aList[8]) test.compare(findObject(":Addresses.altAddressCountry_QLineEdit").text, aList[9]) if(aList[10] == "true"): test.compare(findObject(":Addresses.copyAddressFromPrimary_QCheckBox").checked, True) else: test.compare(findObject(":Addresses.copyAddressFromPrimary_QCheckBox").checked, False)
def checkDetailsValues( dList): test.compare(findObject(":Details.name_QLineEdit").text, dList[0]) test.compare(findObject(":Details.website_QLineEdit").text, dList[1]) test.compare(findObject(":Details.tyckerSymbol_QLineEdit").text, dList[2]) test.compare(findObject(":Details.parentName_QComboBox").currentText, dList[3]) test.compare(findObject(":Details.ownership_QLineEdit").text, dList[4]) test.compare(findObject(":Details.industry_QComboBox").currentText, dList[5]) test.compare(findObject(":Details.accountType_QComboBox").currentText, dList[6]) test.compare(findObject(":Details.campaignName_QComboBox").currentText, dList[7]) test.compare(findObject(":Details.assignedUserName_QComboBox").currentText, dList[8])
def checkOtherDetailsValues( oList): test.compare(findObject(":Other Details.phoneOffice_QLineEdit").text, oList[0]) test.compare(findObject(":Other Details.phoneFax_QLineEdit").text, oList[1]) test.compare(findObject(":Other Details.phoneAlternate_QLineEdit").text, oList[2]) test.compare(findObject(":Other Details.employees_QLineEdit").text, oList[3]) test.compare(findObject(":Other Details.rating_QLineEdit").text, oList[4]) test.compare(findObject(":Other Details.sicCode_QLineEdit").text, oList[5]) test.compare(findObject(":Other Details.annualRevenue_QLineEdit").text, oList[6]) test.compare(findObject(":Other Details.email1_QLineEdit").text, oList[7])
def checkOtherDetailsValues(oList): test.compare(findObject(":Other Details.status_QComboBox").currentText, oList[0]) test.compare(findObject(":Other Details.statusDescription_QTextEdit").plainText, oList[1]) test.compare(findObject(":Other Details.opportunityAmount_QLineEdit").text, oList[2]) test.compare(findObject(":Other Details.phoneWork_QLineEdit").text, oList[3]) test.compare(findObject(":Other Details.phoneMobile_QLineEdit").text, oList[4]) test.compare(findObject(":Other Details.phoneHome_QLineEdit").text, oList[5]) test.compare(findObject(":Other Details.phoneOther_QLineEdit").text, oList[6]) test.compare(findObject(":Other Details.phoneFax_QLineEdit_2").text, oList[7]) if(oList[8] == "true"): test.compare(findObject(":Other Details.doNotCall_QCheckBox_2").checked, True) else: test.compare(findObject(":Other Details.doNotCall_QCheckBox_2").checked, False) test.compare(findObject(":Other Details.email1_QLineEdit_2").text, oList[9]) test.compare(findObject(":Other Details.email2_QLineEdit").text, oList[10])
def checkAddressesValues(bList, sList): test.compare(findObject(":Addresses.billingAddressStreet_QLineEdit").text, bList[0]) test.compare(findObject(":Addresses.billingAddressCity_QLineEdit").text, bList[1]) test.compare(findObject(":Addresses.billingAddressState_QLineEdit").text, bList[2]) test.compare(findObject(":Addresses.billingAddressPostalcode_QLineEdit").text, bList[3]) test.compare(findObject(":Addresses.billingAddressCountry_QLineEdit").text, bList[4]) test.compare(findObject(":Addresses.shippingAddressStreet_QLineEdit").text, sList[0]) test.compare(findObject(":Addresses.shippingAddressCity_QLineEdit").text, sList[1]) test.compare(findObject(":Addresses.shippingAddressState_QLineEdit").text, sList[2]) test.compare(findObject(":Addresses.shippingAddressPostalcode_QLineEdit").text, sList[3]) test.compare(findObject(":Addresses.shippingAddressCountry_QLineEdit").text, sList[4])
def checkDetailsValues(dList): test.compare(findObject(":Details.name_QLineEdit_3").text, dList[0]) test.compare(findObject(":Details.status_QComboBox").currentText, dList[1]) if(dList[2] == "2/2"): test.compare(findObject(":Details.startDate_QLineEdit").text, "2010-08-02") if(dList[3] == "3/3"): test.compare(findObject(":Details.endDate_QLineEdit").text, "2010-08-10") test.compare(findObject(":Details.campaignType_QComboBox").currentText, dList[4]) test.compare(findObject(":Details.currency_QComboBox").currentText, dList[5]) test.compare(findObject(":Details.budget_QLineEdit").text, dList[6]) test.compare(findObject(":Details.expectedRevenue_QLineEdit").text, dList[7])
def checkOtherDetailsValues(oList): test.compare(findObject(":Other Details.officePhone_QLineEdit").text, oList[0]) test.compare(findObject(":Other Details.mobilePhone_QLineEdit").text, oList[1]) test.compare(findObject(":Other Details.homePhone_QLineEdit").text, oList[2]) test.compare(findObject(":Other Details.otherPhone_QLineEdit").text, oList[3]) test.compare(findObject(":Other Details.fax_QLineEdit").text, oList[4]) if(oList[5] == "3/3"): test.compare(findObject(":Other Details.birthDate_QLineEdit_2").text, "2010-08-10") test.compare(findObject(":Other Details.assistant_QLineEdit").text, oList[6]) test.compare(findObject(":Other Details.assistantPhone_QLineEdit").text, oList[7]) if(oList[8] == "true"): test.compare(findObject(":Other Details.doNotCall_QCheckBox").checked, True ) else: test.compare(findObject(":Other Details.doNotCall_QCheckBox").checked, False )
def checkAddressesValues(aList): test.compare( findObject(":Addresses.primaryAddressStreet_QLineEdit").text, aList[0]) test.compare( findObject(":Addresses.primaryAddressCity_QLineEdit").text, aList[1]) test.compare( findObject(":Addresses.primaryAddressState_QLineEdit").text, aList[2]) test.compare( findObject(":Addresses.primaryAddressPostalcode_QLineEdit").text, aList[3]) test.compare( findObject(":Addresses.primaryAddressCountry_QLineEdit").text, aList[4]) test.compare( findObject(":Addresses.altAddressStreet_QLineEdit").text, aList[5]) test.compare( findObject(":Addresses.altAddressCity_QLineEdit").text, aList[6]) test.compare( findObject(":Addresses.altAddressState_QLineEdit").text, aList[7]) test.compare( findObject(":Addresses.altAddressPostalcode_QLineEdit").text, aList[8]) test.compare( findObject(":Addresses.altAddressCountry_QLineEdit").text, aList[9]) if (aList[10] == "true"): test.compare( findObject(":Addresses.copyAddressFromPrimary_QCheckBox").checked, True) else: test.compare( findObject(":Addresses.copyAddressFromPrimary_QCheckBox").checked, False)
def checkDetailsValues(dList): test.compare(findObject(":Details.leadSource_QComboBox_2").currentText, dList[0]) test.compare(findObject(":Details.leadSourceDescription_QTextEdit").plainText, dList[1]) test.compare(findObject(":Details.campaignName_QComboBox_3").currentText, dList[2]) test.compare(findObject(":Details.referedBy_QLineEdit").text, dList[3]) test.compare(findObject(":Details.salutation_QComboBox").currentText, dList[4]) test.compare(findObject(":Details.firstName_QLineEdit").text, dList[5]) test.compare(findObject(":Details.lastName_QLineEdit").text, dList[6]) if(dList[7] == "2/2"): test.compare(findObject(":Details.birthdate_QLineEdit_2").text, "2010-08-02") test.compare(findObject(":Details.accountName_QLineEdit").text, dList[8]) test.compare(findObject(":Details.title_QLineEdit").text, dList[9]) test.compare(findObject(":Details.department_QLineEdit").text, dList[10]) test.compare(findObject(":Details.assignedUserName_QComboBox_3").currentText, dList[11])
def checkDescriptionValue(description): test.compare( findObject(":Description:.description_QTextEdit_3").plainText, description)
def checkAddressesValues(bList, sList): test.compare( findObject(":Addresses.billingAddressStreet_QLineEdit").text, bList[0]) test.compare( findObject(":Addresses.billingAddressCity_QLineEdit").text, bList[1]) test.compare( findObject(":Addresses.billingAddressState_QLineEdit").text, bList[2]) test.compare( findObject(":Addresses.billingAddressPostalcode_QLineEdit").text, bList[3]) test.compare( findObject(":Addresses.billingAddressCountry_QLineEdit").text, bList[4]) test.compare( findObject(":Addresses.shippingAddressStreet_QLineEdit").text, sList[0]) test.compare( findObject(":Addresses.shippingAddressCity_QLineEdit").text, sList[1]) test.compare( findObject(":Addresses.shippingAddressState_QLineEdit").text, sList[2]) test.compare( findObject(":Addresses.shippingAddressPostalcode_QLineEdit").text, sList[3]) test.compare( findObject(":Addresses.shippingAddressCountry_QLineEdit").text, sList[4])
def checkAddressesValues(aList): test.compare(findObject(":Addresses.primaryAddress_QLineEdit").text, aList[0]) test.compare(findObject(":Addresses.city_QLineEdit").text, aList[1]) test.compare(findObject(":Addresses.state_QLineEdit").text, aList[2]) test.compare(findObject(":Addresses.postalCode_QLineEdit").text, aList[3]) test.compare(findObject(":Addresses.country_QLineEdit").text, aList[4]) test.compare(findObject(":Addresses.otherAddress_QLineEdit").text, aList[5]) test.compare(findObject(":Addresses.otherCity_QLineEdit").text, aList[6]) test.compare(findObject(":Addresses.otherState_QLineEdit").text, aList[7]) test.compare(findObject(":Addresses.otherPostalCode_QLineEdit").text, aList[8]) test.compare(findObject(":Addresses.otherCountry_QLineEdit").text, aList[9])
def checkOtherDetailsValues(oList): test.compare( findObject(":Other Details.phoneOffice_QLineEdit").text, oList[0]) test.compare( findObject(":Other Details.phoneFax_QLineEdit").text, oList[1]) test.compare( findObject(":Other Details.phoneAlternate_QLineEdit").text, oList[2]) test.compare( findObject(":Other Details.employees_QLineEdit").text, oList[3]) test.compare(findObject(":Other Details.rating_QLineEdit").text, oList[4]) test.compare(findObject(":Other Details.sicCode_QLineEdit").text, oList[5]) test.compare( findObject(":Other Details.annualRevenue_QLineEdit").text, oList[6]) test.compare(findObject(":Other Details.email1_QLineEdit").text, oList[7])
def checkDetailsValues(dList): test.compare(findObject(":Details.name_QLineEdit_2").text, dList[0]) test.compare( findObject(":Details.accountName_QComboBox").currentText, dList[1]) test.compare( findObject(":Details.opportunityType_QComboBox").currentText, dList[2]) test.compare( findObject(":Details.leadSource_QComboBox").currentText, dList[3]) test.compare( findObject(":Details.campaignName_QComboBox_2").currentText, dList[4]) test.compare( findObject(":Details.salesStage_QComboBox").currentText, dList[5]) test.compare( findObject(":Details.assignedUserName_QComboBox_2").currentText, dList[6])
def logdoc11(frame,h,w,root): frame.pack_forget() frame = Frame(root,width=w,height=h) frame.pack() load=Image.open("Bank.jpg") render=ImageTk.PhotoImage(load) img=Label(frame,image=render) img.image=render img.place(x=300,y=0) import test label = Label(frame,text = "Confusion Matrix: "+str(test.cm),font=("Calibri",15)) label = Label(frame,text = "The accuracy of this model in classsifying the customer is "+str(test.accuracy*100),font=("Calibri",15)) label.pack() label.place(x=360,y=200) #label = Label(frame,text = str(test.y_pred),font=("Calibri",15)) #label.pack() #label.place(x=550,y=550) class PandasModel(QtCore.QAbstractTableModel): def __init__(self, data, parent=None): QtCore.QAbstractTableModel.__init__(self, parent) self._data = data def rowCount(self, parent=None): return len(self._data.values) def columnCount(self, parent=None): return self._data.columns.size def data(self, index, role=QtCore.Qt.DisplayRole): if index.isValid(): if role == QtCore.Qt.DisplayRole: if(index.column() != 0): return str('%.2f'%self._data.values[index.row()][index.column()]) else: return str(self._data.values[index.row()][index.column()]) return None def headerData(self, section, orientation, role): if orientation == QtCore.Qt.Horizontal and role == QtCore.Qt.DisplayRole: return self._data.columns[section] elif orientation == QtCore.Qt.Vertical and role == QtCore.Qt.DisplayRole: return str(self._data.index[section]) return None def flags(self, index): flags = super(self.__class__,self).flags(index) flags |= QtCore.Qt.ItemIsSelectable flags |= QtCore.Qt.ItemIsEnabled return flags import pandas as pd import numpy as np x=test.compare(test.X_testmod,test.y_predmod) df = pd.DataFrame(x) del df['Row_number'] app = QtWidgets.QApplication([]) table = QtWidgets.QTableView() mymodel = PandasModel(df) table.setModel(mymodel) table.show() app.exec_() home=Button(frame, text = 'Back to Previous Page',font=("Calibri",15),command=lambda:logdoc10(frame,h,w,root)) home.pack() home.place(x=1100,y=660) test.drawAccuracy()
def checkOtherDetailsValues(oList): test.compare(findObject(":Other Details.assignedUserName_QComboBox").currentText, oList[0]) test.compare(findObject(":Other Details.impressions_QLineEdit").text, oList[1]) test.compare(findObject(":Other Details.actualCost_QLineEdit").text, oList[2]) test.compare(findObject(":Other Details.expectedCost_QLineEdit").text, oList[3]) test.compare(findObject(":Other Details.objective_QTextEdit").plainText, oList[4])