in ees_microsoft_outlook/utils.py [0:0]
def split_list_into_buckets(documents, total_buckets):
"""Divide large number of documents amongst the total buckets
:param documents: list to be partitioned
:param total_buckets: number of buckets to be formed
"""
if documents:
groups = min(total_buckets, len(documents))
group_list = []
for i in range(groups):
group_list.append(documents[i::groups])
return group_list
else:
return []