<commit_before># Import required modules
import os

# Import custom modules
import app
import input
import output
import ballot
import keys
import crypto

# Create a new ballot
def initaliseBallot():

    # Get the name of the ballot
    title = raw_input("Title of the ballot: ")

    # Get the description of the ballot
    description = raw_input("Description for the ballot: ")

    # Get the ballot candidates
    candidatesString = raw_input("Please enter the candidates separated by commas (','): ")
    candidates = candidatesString.split(",")

    # Get the voter addresses
    votersString = raw_input("Please enter the voter addresses separated by commas (','): ")
    voters = votersString.split(",")

    # Get the ballot public key
    print 'Select the key you want to use for the ballot.'
    key = input.getKeySelection()

    # Get the Ethereum account to use
    print 'Select the account you want to use for the ballot.'
    account = input.getAccountSelection()

    # Initalise a ballot with the given values
    ballot.initalise(account, title, description, candidates, voters, key)

# List the ballots in the console
def listBallots():
    output.allBallots()

# Get more information about a ballot
def ballotInfo():

    # Get the ballot
    print 'Select the ballot you wish to see more information about.'
    ballot = input.getBallotSelection()

    # Display the ballot information
    output.ballotInfo(ballot)

# Cast a vote
def castVote():

    # Get the ballot
    print 'Select the ballot you want to vote in.'
    selectedBallot = input.getBallotSelection()

    # Get the Ethereum account to use
    print 'Select the account you want to use to vote.'
    account = input.getAccountSelection()

    # Display the ballot information
    output.ballotInfo(selectedBallot, False, False)

    # Get the candidate to vote for
    print 'Select the candidate you wish to vote for.'
    candidate = input.getCandidateSelection(selectedBallot)

    # Build the vote to send
    vote = ballot.buildVote(selectedBallot, candidate)

    # Execute the vote
    ballot.executeVote(selectedBallot, account, vote)

# Import a ballot
def importBallot():

    # Get the path for the ballot file
    filePath = raw_input("Please give the path to the ballot file: ")

    # Import the ballot file at the given path
    ballot.importBallot(filePath)

    # Return control to the program
    print 'Ballot at "' + filePath + '" saved.'

# Export a ballot
def exportBallot():

    # Get the ballot
    print 'Select the ballot you wish to export.'
    ballotToExport = input.getBallotSelection()

    # Check if a ballot was selected
    if ballotToExport == False:

        # Invalid index or name given
        print 'Ballot not found.'

    else:

        # Export the ballot
        ballot.export(ballotToExport)

        # Return control to the program
        print 'Ballot "' + ballotToExport.title + '" exported to: ' + os.getcwd() + '/' + ballotToExport.title + ' Export.csv'


# TODO Check the integrity of a ballot's votes
def checkIntegrity():
    print 'TODO'

# Tally the votes of a ballot
def tallyResults():

    # Get the ballot
    ballotToTally = input.getBallotSelection()

    # Show the saved keys and get the users selection
    print 'Select the key used for the ballot. You need the private key to view the result.'<commit_msg>Removing unimplemented command<commit_after># Import required modules
import os

# Import custom modules
import app
import input
import output
import ballot
import keys
import crypto

# Create a new ballot
def initaliseBallot():

    # Get the name of the ballot
    title = raw_input("Title of the ballot: ")

    # Get the description of the ballot
    description = raw_input("Description for the ballot: ")

    # Get the ballot candidates
    candidatesString = raw_input("Please enter the candidates separated by commas (','): ")
    candidates = candidatesString.split(",")

    # Get the voter addresses
    votersString = raw_input("Please enter the voter addresses separated by commas (','): ")
    voters = votersString.split(",")

    # Get the ballot public key
    print 'Select the key you want to use for the ballot.'
    key = input.getKeySelection()

    # Get the Ethereum account to use
    print 'Select the account you want to use for the ballot.'
    account = input.getAccountSelection()

    # Initalise a ballot with the given values
    ballot.initalise(account, title, description, candidates, voters, key)

# List the ballots in the console
def listBallots():
    output.allBallots()

# Get more information about a ballot
def ballotInfo():

    # Get the ballot
    print 'Select the ballot you wish to see more information about.'
    ballot = input.getBallotSelection()

    # Display the ballot information
    output.ballotInfo(ballot)

# Cast a vote
def castVote():

    # Get the ballot
    print 'Select the ballot you want to vote in.'
    selectedBallot = input.getBallotSelection()

    # Get the Ethereum account to use
    print 'Select the account you want to use to vote.'
    account = input.getAccountSelection()

    # Display the ballot information
    output.ballotInfo(selectedBallot, False, False)

    # Get the candidate to vote for
    print 'Select the candidate you wish to vote for.'
    candidate = input.getCandidateSelection(selectedBallot)

    # Build the vote to send
    vote = ballot.buildVote(selectedBallot, candidate)

    # Execute the vote
    ballot.executeVote(selectedBallot, account, vote)

# Import a ballot
def importBallot():

    # Get the path for the ballot file
    filePath = raw_input("Please give the path to the ballot file: ")

    # Import the ballot file at the given path
    ballot.importBallot(filePath)

    # Return control to the program
    print 'Ballot at "' + filePath + '" saved.'

# Export a ballot
def exportBallot():

    # Get the ballot
    print 'Select the ballot you wish to export.'
    ballotToExport = input.getBallotSelection()

    # Check if a ballot was selected
    if ballotToExport == False:

        # Invalid index or name given
        print 'Ballot not found.'

    else:

        # Export the ballot
        ballot.export(ballotToExport)

        # Return control to the program
        print 'Ballot "' + ballotToExport.title + '" exported to: ' + os.getcwd() + '/' + ballotToExport.title + ' Export.csv'

# Tally the votes of a ballot
def tallyResults():

    # Get the ballot
    ballotToTally = input.getBallotSelection()

    # Show the saved keys and get the users selection
    print 'Select the key used for the ballot. You need the private key to view the result.'
{'fraction_non_alphanumeric': 0.07431316619126258, 'fraction_numerical': 0.0, 'mean_word_length': 3.205808080808081, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4346920', 'n_tokens_mistral': 1926, 'n_tokens_neox': 1761, 'n_words': 761}