Skip to content

Instantly share code, notes, and snippets.

@heynemann
Created August 13, 2012 14:44
Show Gist options
  • Save heynemann/3341367 to your computer and use it in GitHub Desktop.
Save heynemann/3341367 to your computer and use it in GitHub Desktop.
r3 sample stream
#!/usr/bin/python
# -*- coding: utf-8 -*-
from os.path import abspath, dirname, join
class CountWordsStream:
job_type = 'count-words'
group_size = 1000
def process(self, app, arguments):
with open(abspath(join(dirname(__file__), 'chekhov.txt'))) as f:
contents = f.readlines()
return [line.lower() for line in contents]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment