Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Program to find any vote-switching due to problems in the vote counting machines
- # fraudcatchv2.py (modified from what Pede created)
- import json
- def findfraudAgainstTrump(NAME):
- """ Function to find vote-switching fraud against Trump in any particular US state 2020 election JSON file """
- with open(NAME + '.json', encoding="utf8") as f:
- x = json.load(f)
- TotalVotesLost = 0
- # If the votes in a particular time-series entry for Trump are less than in the previous time-series entry, but those for Biden are more,
- # calculate the number of votes switched in favor of Biden.
- for i in range(len(x["data"]["races"][0]["timeseries"])):
- if i != 0 and x["data"]["races"][0]["timeseries"][i]["votes"] * x["data"]["races"][0]["timeseries"][i]["vote_shares"]["trumpd"] < x["data"]["races"][0]["timeseries"][i-1]["votes"] * x["data"]["races"][0]["timeseries"][i-1]["vote_shares"]["trumpd"]:
- if x["data"]["races"][0]["timeseries"][i]["votes"] * x["data"]["races"][0]["timeseries"][i]["vote_shares"]["bidenj"] > x["data"]["races"][0]["timeseries"][i-1]["votes"] * x["data"]["races"][0]["timeseries"][i-1]["vote_shares"]["bidenj"]:
- print ("Index : " + str(i) + " ~~~ " + \
- "EEVP_SOURCE: " + x["data"]["races"][0]["timeseries"][i]["eevp_source"] + " ~~~ " + \
- x["data"]["races"][0]["timeseries"][i]["timestamp"] + " ~~~ " + \
- " Past Index : " + str(i-1) + " ~~~ " + \
- "EEVP_SOURCE: " + x["data"]["races"][0]["timeseries"][i-1]["eevp_source"] + " ~~~ " + \
- x["data"]["races"][0]["timeseries"][i-1]["timestamp"] + " ~~~ ")
- print (x["data"]["races"][0]["timeseries"][i]["votes"] * x["data"]["races"][0]["timeseries"][i]["vote_shares"]["trumpd"] - x["data"]["races"][0]["timeseries"][i-1]["votes"] * x["data"]["races"][0]["timeseries"][i-1]["vote_shares"]["trumpd"])
- TotalVotesLost += x["data"]["races"][0]["timeseries"][i]["votes"] * x["data"]["races"][0]["timeseries"][i]["vote_shares"]["trumpd"] - x["data"]["races"][0]["timeseries"][i-1]["votes"] * x["data"]["races"][0]["timeseries"][i-1]["vote_shares"]["trumpd"]
- print ("Votes reduced for Trump: ", str(str(TotalVotesLost) + " Flo" + "\n"))
- def findfraudAgainstBiden(NAME):
- """ Function to find vote-switching fraud against Biden in any particular US state 2020 election JSON file """
- with open(NAME + '.json', encoding="utf8") as f:
- x = json.load(f)
- TotalVotesLost = 0
- # If the votes in a particular time-series entry for Biden are less than in the previous time-series entry, but those for Trump are more,
- # calculate the number of votes switched in favor of Trump.
- for i in range(len(x["data"]["races"][0]["timeseries"])):
- if i != 0 and x["data"]["races"][0]["timeseries"][i]["votes"] * x["data"]["races"][0]["timeseries"][i]["vote_shares"]["bidenj"] < x["data"]["races"][0]["timeseries"][i-1]["votes"] * x["data"]["races"][0]["timeseries"][i-1]["vote_shares"]["bidenj"]:
- if x["data"]["races"][0]["timeseries"][i]["votes"] * x["data"]["races"][0]["timeseries"][i]["vote_shares"]["trumpd"] > x["data"]["races"][0]["timeseries"][i-1]["votes"] * x["data"]["races"][0]["timeseries"][i-1]["vote_shares"]["trumpd"]:
- print ("Index : " + str(i) + " ~~~ " + \
- "EEVP_SOURCE: " + x["data"]["races"][0]["timeseries"][i]["eevp_source"] + " ~~~ " + \
- x["data"]["races"][0]["timeseries"][i]["timestamp"] + " ~~~ " + \
- " Past Index : " + str(i-1) + " ~~~ " + \
- "EEVP_SOURCE: " + x["data"]["races"][0]["timeseries"][i-1]["eevp_source"] + " ~~~ " + \
- x["data"]["races"][0]["timeseries"][i-1]["timestamp"] + " ~~~ ")
- print (x["data"]["races"][0]["timeseries"][i]["votes"] * x["data"]["races"][0]["timeseries"][i]["vote_shares"]["bidenj"] - x["data"]["races"][0]["timeseries"][i-1]["votes"] * x["data"]["races"][0]["timeseries"][i-1]["vote_shares"]["bidenj"])
- TotalVotesLost += x["data"]["races"][0]["timeseries"][i]["votes"] * x["data"]["races"][0]["timeseries"][i]["vote_shares"]["bidenj"] - x["data"]["races"][0]["timeseries"][i-1]["votes"] * x["data"]["races"][0]["timeseries"][i-1]["vote_shares"]["bidenj"]
- print ("Votes reduced for Biden: ", str(str(TotalVotesLost) + " Flo" + "\n"))
- def findfraud2(NAME):
- """ Function to find total votes lost (for both candidates together) in any particular US state 2020 election JSON file """
- with open(NAME + '.json', encoding="utf8") as f:
- x = json.load(f)
- TotalVotesLost = 0
- for i in range(len(x["data"]["races"][0]["timeseries"])):
- if i != 0 and x["data"]["races"][0]["timeseries"][i]["votes"] < x["data"]["races"][0]["timeseries"][i-1]["votes"]:
- TotalVotesLost += x["data"]["races"][0]["timeseries"][i]["votes"] - x["data"]["races"][0]["timeseries"][i-1]["votes"]
- print (TotalVotesLost)
- def main():
- """ The main part of the program, where execution starts """
- list_of_state_files_without_json_extension = ["alabama", "alaska", "arizona",
- "arkansas", "california", "colorado", "connecticut", "delaware",
- "districtofcolumbia", "florida", "georgia", "idaho", "illinois", "indiana",
- "iowa", "jersey", "kansas", "kentucky", "louisiana", "maine", "maryland",
- "massachusetts", "mexico", "michigan", "minnesota", "mississippi", "missouri",
- "montana", "nebraska", "nevada", "newhamp", "newyork", "northcarolina",
- "northdakota", "ohio", "oklahoma", "oregon", "pennsylvania", "rhode",
- "southcarolina", "southdakota", "tenn", "texas", "utah", "vermont", "virginia",
- "washington", "westvirginia", "wisconsin", "wyoming"]
- for state in list_of_state_files_without_json_extension:
- print(state.upper(), " VOTES REDUCED FOR TRUMP - ANALYSIS")
- print("------------------------------")
- findfraudAgainstTrump(state)
- print(state.upper(), " VOTES REDUCED FOR BIDEN - ANALYSIS")
- print("------------------------------")
- findfraudAgainstBiden(state)
- print(state.upper(), " VOTES LOST (FOR BOTH CANDIDATES TOGETHER) - ANALYSIS")
- print("------------------------------")
- findfraud2(state)
- print()
- print()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment