diff options
author | zsloan | 2016-06-20 11:03:20 -0500 |
---|---|---|
committer | GitHub | 2016-06-20 11:03:20 -0500 |
commit | 8222ef16d443dc41db9d7e09b1af400d8d866854 (patch) | |
tree | e4f5b49aa21c32aa2b770b1a65c8fef7782b625f /wqflask/utility/chunks.py | |
parent | d90dc3748557d1d6fbaa59f71fe676b8a7c393ca (diff) | |
parent | 10df36b60273d81678f6630c07a2d8e5a6409282 (diff) | |
download | genenetwork2-8222ef16d443dc41db9d7e09b1af400d8d866854.tar.gz |
Merge pull request #168 from genenetwork/staging
Staging
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 |