summary refs log tree commit diff
path: root/bin/tw-mh-split-mirrorset.py
diff options
context:
space:
mode:
authorFranck Cuny <fcuny@twitter.com>2017-11-07 08:47:26 -0800
committerFranck Cuny <fcuny@twitter.com>2017-11-07 08:47:26 -0800
commit28cadb970ca0b1ae6cde58d09eadb6af89999ddf (patch)
tree3f3d0096bc041ed74868872c43beb9612afebc75 /bin/tw-mh-split-mirrorset.py
parent[emacs] add scala-mode (diff)
downloademacs.d-28cadb970ca0b1ae6cde58d09eadb6af89999ddf.tar.gz
Remove bin, this is now in it's own repo
Diffstat (limited to '')
-rwxr-xr-xbin/tw-mh-split-mirrorset.py34
1 files changed, 0 insertions, 34 deletions
diff --git a/bin/tw-mh-split-mirrorset.py b/bin/tw-mh-split-mirrorset.py
deleted file mode 100755
index 4a3d228..0000000
--- a/bin/tw-mh-split-mirrorset.py
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/usr/bin/env python
-
-import sys
-from collections import defaultdict
-
-
-def main():
-  input = sys.argv[1]
-  batch_number = sys.argv[2]
-  mms = {}
-
-  max_mmset_size = 0
-
-  with open(input, 'r') as f:
-    for l in f:
-      mm, hostname = l.rstrip().split(' ')
-      if mm not in mms:
-        mms[mm] = []
-      mms[mm].append(hostname)
-
-  max_mmset_size = max([len(mms[x]) for x in mms])
-
-  batches = {x: [] for x in range(0, max_mmset_size)}
-  for i in range(0, max_mmset_size):
-    for mm in mms:
-      if len(mms[mm]) -1 >= i:
-        batches[i].append(mms[mm][i])
-
-  for h in batches[int(batch_number)]:
-    print(h)
-
-
-if __name__ == '__main__':
-  main()