Helper for avg calculation

This commit is contained in:
shortcutme 2018-01-19 02:21:54 +01:00
parent 814fa881d0
commit d17cb3fafc
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE

View file

@ -211,3 +211,9 @@ def limitedGzipFile(*args, **kwargs):
def read(self, size=-1): def read(self, size=-1):
return super(LimitedGzipFile, self).read(1024*1024*6) return super(LimitedGzipFile, self).read(1024*1024*6)
return LimitedGzipFile(*args, **kwargs) return LimitedGzipFile(*args, **kwargs)
def avg(items):
if len(items) > 0:
return sum(items) / len(items)
else:
return 0