This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# content provided as part of thread here: https://www.reddit.com/r/aws/comments/cffmxr/how_do_you_strip_the_attachments_from_aws_sessns/ | |
from email.parser import BytesParser | |
from email import policy | |
import os | |
# event will be JSON from SES incoming email rule - NOT an S3 PUT event | |
def lambda_handler(event, context): | |
try: | |
ses_mail = event['Records'][0]['ses']['mail'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
from itertools import combinations | |
import requests | |
import networkx as nx | |
def get_senate_vote(vote): | |
# Year can be replaced to fetch votes from different years (e.g., 2013). 1989 is used | |
# as an example. |