Commit 6bfedaf8 by Ethan Mertz

fixed merge

parents 454363b4 be00b628
import re
import sys
def go(subset):
'''
......
import re
import sys
def go(subset):
'''
......
......@@ -4,7 +4,7 @@ import heapq
import jellyfish
#Sek k of top-k entries to collect.
CAPACITY = 200
CAPACITY = 500
class TopFunctions(MRJob):
def mapper(self, _, line):
......
......@@ -6,8 +6,6 @@ import math
CAPACITY = 500
VARIABLE_REGEX = ("[\s]*([\w, ]+)[\s]*=")
class TopVariables(MRJob):
def mapper(self, _, line):
......@@ -91,7 +89,7 @@ class TopVariables(MRJob):
for i in range(len(self.h)):
item = heapq.heappop(self.h)
#Yield the mean scores.
yield item[1], -item[0] / self.total
yield item[1], -item[0] / (self.total - 1)
if __name__ == '__main__':
TopVariables.run()
\ No newline at end of file
......@@ -17,7 +17,7 @@ def to_json(filename, dataname):
#Converts each line into a dictonary entry.
name, score = result.split("\t")
name = name.replace('"', '')
score = score.strip()
resultdict[name] = float(score)
score = score.strip()
resultdict[name] = float(score) * 100
with open(dataname, 'w') as datafile:
json.dump(resultdict, datafile)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment