From: Neil Smith Date: Tue, 5 Nov 2013 11:11:36 +0000 (+0000) Subject: Few more whitespace tweaks X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=d89e4fd0c7455c64099319a0dbfc3f36ad1f5baf;p=cipher-tools.git Few more whitespace tweaks --- diff --git a/norms.py b/norms.py index 08cff74..f9fc1d7 100644 --- a/norms.py +++ b/norms.py @@ -13,7 +13,8 @@ def normalise(frequencies): [(1, 0.4082482904638631), (2, 0.8164965809277261), (3, 0.4082482904638631)] """ length = sum([f ** 2 for f in frequencies.values()]) ** 0.5 - return collections.defaultdict(int, ((k, v / length) for (k, v) in frequencies.items())) + return collections.defaultdict(int, ((k, v / length) + for (k, v) in frequencies.items())) def scale(frequencies): """Scale a set of frequencies so the largest is 1 @@ -28,7 +29,8 @@ def scale(frequencies): [(1, 0.5), (2, 1.0), (3, 0.5)] """ largest = max(frequencies.values()) - return collections.defaultdict(int, ((k, v / largest) for (k, v) in frequencies.items())) + return collections.defaultdict(int, ((k, v / largest) + for (k, v) in frequencies.items())) def l2(frequencies1, frequencies2):