def add_new_application():
	passwords = []
	print 'How many passwords would you like to generate:'
	num_pass = int(input())
	
	for i in range(num_pass):
		passwords.append(gen_pass.generate_password(25, -1, 1, 1, 1, 1))

	print "\n\tGENERATED PASSWORDS"
	print "---------------------------------------"
	for i in range(len(passwords)):
		print str(i+1) + ' - ' + passwords[i]
	
	print '\n\nSelected Password : '******'Selected Password : '******'Password Copied to Clipboard'

	print '\n\n\nWhat is the Application Name you want the password for : '
	application_name = raw_input('Application Name : ')
	
	data.append([application_name, encryption.encrypt_data(passwords[selected_pass], 'paradise')])
	save_data(data)
def view_password():
	global data

	print '\n\n\tPlease Select an Application'
	print '--------------------------------------------------\n'

	for i in range(len(data)):
		print str(i+1) + " - " + data[i][0]
	
	selected_app = int(input('\nApplication : '))
	clipboard.clipboard(encryption.decrypt_data(data[selected_app-1][1], 'paradise'))
	print 'Selected Application Password Copied to Clipboard'
Пример #3
0
def main(content):
    output = []
    output.append(
        'positive_class,confidence,tp,tn,fp,fn,discarded_fn,precision,recall,recall_adjusted,accuracy,f1'
        .replace(',', '\t'))
    confidences = [0.5, 0.6, 0.7, 0.8, 0.9, 0.0]
    lines_str = content.split('\n')[1:]  # skip header
    lines = [line.split('\t') for line in lines_str if len(line) > 0]

    for confidence in confidences:
        for posi_class in ['satd', 'fixed']:
            # [tp, tn, fp, fn, adjust_recall]
            metrics = [0, 0, 0, 0, 0]
            for line in lines:
                index = 0
                # [index	satd_id	predicted	actual	confidence ]
                # ['1', '3', 'fixed', 'satd', 'fixed:0.639131;satd:0.359158']
                actual = line[3]
                predicted = line[2]
                predicted_confidence = _pred_conf(predicted, line[4])
                index = (0 if actual == predicted else 2) + \
                        (0 if actual == posi_class else 1)
                if predicted_confidence >= confidence:
                    metrics[index] += 1
                else:
                    # adjust for recall definition; we account for discarded wrong
                    pass
                    if index == 3:  # if false negative
                        metrics[4] += 1

            output.append(
                f'{posi_class},{confidence},{RelevanceMeasures(*metrics).round().csv()}'
                .replace(',', '\t'))
    outputf = '\n'.join(output)
    print(outputf)
    clipboard(outputf)
Пример #4
0
#                                                                          #
#    You should have received a copy of the GNU General Public License     #
#    along with this program; if not, write to the                         #
#    Free Software Foundation, Inc.,                                       #
#    59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             #
############################################################################

import pygtk; pygtk.require("2.0")
import gtk

window = gtk.Window(gtk.WINDOW_TOPLEVEL)
window.set_title("GPytage")
__editedState = False

from clipboard import clipboard
clipboard = clipboard()

def setTitleEdited(bool):
    """
    Changes the state of the title. Edited state causes the title to change to *GPytage.
    
    True: Sets as edited
    
    """
    global __editedState
    if bool is True:
        window.set_title("*GPytage")
        __editedState = True
    else:
        window.set_title("GPytage")
        __editedState = False