Skip to content

Instantly share code, notes, and snippets.

View bsimpson63's full-sized avatar

Brian Simpson bsimpson63

View GitHub Profile
def keep_fn(self):
def keep(item):
return (not item._spam or
(c.user_is_loggedin and
(item.author_id == c.user._id or
c.user_is_admin or
item.subreddit.is_moderator(c.user))))
return keep
from boto.emr.connection import EmrConnection
from boto.emr.step import InstallPigStep, PigStep
AWS_ACCESS_KEY = '' # REQUIRED
AWS_SECRET_KEY = '' # REQUIRED
conn = EmrConnection(AWS_ACCESS_KEY, AWS_SECRET_KEY)
pig_file = 's3://elasticmapreduce/samples/pig-apache/do-reports2.pig'
INPUT = 's3://elasticmapreduce/samples/pig-apache/input/access_log_1'
OUTPUT = '' # REQUIRED, S3 bucket for job output