<s> from pyspark import SparkContext <EOL> def main ( ) : <EOL> sc = SparkContext ( appName = '<STR_LIT>' ) <EOL> input_file = sc . textFile ( '<STR_LIT>' ) <EOL> counts = input_file . flatMap ( lambda line : line . split ( ) ) . map ( lambda word : ( word , <NUM_LIT:1> ) ) . reduceByKey ( lambda a , b : a + b ) <EOL> counts . saveAsTextFile ( '<STR_LIT>' ) <EOL> sc . stop ( ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> main ( ) </s>
