diff options
author | zsloan | 2016-06-20 16:01:12 +0000 |
---|---|---|
committer | zsloan | 2016-06-20 16:01:12 +0000 |
commit | 30a37c6f1f9a9f759a92fd61876af9e9e3d078b9 (patch) | |
tree | e4f5b49aa21c32aa2b770b1a65c8fef7782b625f /wqflask/utility/chunks.py | |
parent | 4fec0e6fc0772785a30451d417082bc189f2f6dd (diff) | |
parent | 10df36b60273d81678f6630c07a2d8e5a6409282 (diff) | |
download | genenetwork2-30a37c6f1f9a9f759a92fd61876af9e9e3d078b9.tar.gz |
Merge branch 'staging' of github.com:genenetwork/genenetwork2 into development
Diffstat (limited to 'wqflask/utility/chunks.py')
-rw-r--r-- | wqflask/utility/chunks.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/wqflask/utility/chunks.py b/wqflask/utility/chunks.py index 9565fb96..b0e33c08 100644 --- a/wqflask/utility/chunks.py +++ b/wqflask/utility/chunks.py @@ -6,21 +6,21 @@ import time def divide_into_chunks(the_list, number_chunks): """Divides a list into approximately number_chunks smaller lists - + >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 3) [[1, 2, 7], [3, 22, 8], [5, 22, 333]] - >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 4) + >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 4) [[1, 2, 7], [3, 22, 8], [5, 22, 333]] - >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 5) + >>> divide_into_chunks([1, 2, 7, 3, 22, 8, 5, 22, 333], 5) [[1, 2], [7, 3], [22, 8], [5, 22], [333]] >>> - + """ length = len(the_list) if length == 0: return [[]] - + if length <= number_chunks: number_chunks = length |