示例#1
0
import matplotlib.pyplot as plt
from scipy import stats

#import random as rnd
path = sys.argv[1]
path2 = sys.argv[2]
path3 = sys.argv[3]

parsedLog = AuditLog(open(path, 'r'))
parsedEL68A = el68a.EL68A(open(path3, 'r'))
parsedBallotImage = BallotImage(open(path2, 'r'), parsedLog, parsedEL68A)

# first generate list of valid machines
dateModObject = dateMod.DateMod(parsedLog, parsedEL68A.electionDate)
times, a = dateMod.timeopen(parsedLog, dateModObject.eday)
mmap = dateMod.timecheck(times)
validMachines = mmap.keys()
pollOpenLate = analysis_places_open_late2.open_late(parsedLog,
                                                    parsedBallotImage,
                                                    validMachines)
mapMachA, mapMachB, lTV, pA, pB = consecutiveVotes(parsedLog,
                                                   parsedBallotImage,
                                                   validMachines, pollOpenLate)
#for key, value in sorted(pA.iteritems(), key=lambda (k,v): (v,k), reverse = False):
#print "%3s                 %s" % (key, value)

mapTimeVotes = {}
for time in lTV:
    if not time in mapTimeVotes:
        mapTimeVotes[time] = 1
    else:
示例#2
0
import matplotlib.pyplot as plt
from scipy import stats

#import random as rnd
path = sys.argv[1]
path2 = sys.argv[2]
path3 = sys.argv[3]

parsedLog = AuditLog(open(path, 'r'))
parsedEL68A = el68a.EL68A(open(path3, 'r'))
parsedBallotImage = BallotImage(open(path2, 'r'), parsedLog, parsedEL68A)

# first generate list of valid machines
dateModObject = dateMod.DateMod(parsedLog, parsedEL68A.electionDate)
times, a = dateMod.timeopen(parsedLog, dateModObject.eday)
mmap = dateMod.timecheck(times)
validMachines = mmap.keys()
pollOpenLate = analysis_places_open_late2.open_late(parsedLog, parsedBallotImage, validMachines)
mapMachA, mapMachB, lTV, pA, pB = consecutiveVotes(parsedLog, parsedBallotImage, validMachines, pollOpenLate)
#for key, value in sorted(pA.iteritems(), key=lambda (k,v): (v,k), reverse = False):
    #print "%3s                 %s" % (key, value)

mapTimeVotes = {}
for time in lTV:
    if not time in mapTimeVotes:
        mapTimeVotes[time] = 1
    else:
        mapTimeVotes[time] += 1
#rnd.seed()

pollLoc7, pollLoc8, pollLoc9, pollLoc10, pollLoc11, pollLoc12, pollLoc13, pollLoc14, pollLoc15, pollLoc16, pollLoc17, pollLoc18, pollLoc19 = longLine(parsedBallotImage, mapMachA, mapMachB)
示例#3
0
    for key in sorted(pMap):
        print "Precinct #"+str(key)+" had machines idle for the times: "+str(pMap[key])
    return

#TEST THE FUNCTION
import os, sys
cmd_folder = os.getenv('HOME') + '/audit-bear/modules'
if cmd_folder not in sys.path:
    sys.path.insert(0, cmd_folder)
    
from auditLog import AuditLog
from ballotImage import BallotImage

import dateMod
import datetime
import dateutil.parser

path = sys.argv[1]
path2 = sys.argv[2]
path3 = sys.argv[3]

fh = AuditLog(open(path, 'r'))
parsedBallotImage = BallotImage(open(path2, 'r'), AuditLog(open(path, 'r')), open(path3, 'r'))

dateModObject = dateMod.DateMod(fh, open(path3, 'r'))
mmap = dateMod.timecheck(dateMod.timeopen(dateModObject.edata))
validMachines = mmap.keys()

machinesIdle(fh, parsedBallotImage, validMachines)
示例#4
0
            key) + " had machines idle for the times: " + str(pMap[key])
    return


#TEST THE FUNCTION
import os, sys
cmd_folder = os.getenv('HOME') + '/audit-bear/modules'
if cmd_folder not in sys.path:
    sys.path.insert(0, cmd_folder)

from auditLog import AuditLog
from ballotImage import BallotImage

import dateMod
import datetime
import dateutil.parser

path = sys.argv[1]
path2 = sys.argv[2]
path3 = sys.argv[3]

fh = AuditLog(open(path, 'r'))
parsedBallotImage = BallotImage(open(path2, 'r'), AuditLog(open(path, 'r')),
                                open(path3, 'r'))

dateModObject = dateMod.DateMod(fh, open(path3, 'r'))
mmap = dateMod.timecheck(dateMod.timeopen(dateModObject.edata))
validMachines = mmap.keys()

machinesIdle(fh, parsedBallotImage, validMachines)