Coverage for dashboard\helpers.py: 30%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

10 statements  

1import os 

2from django.conf import settings 

3 

4def split_every(iterable, size=1000): 

5 """ 

6 Split the list into chunks 

7 """ 

8 iterableLength = len(iterable) 

9 for idx in range(0, iterableLength, size): 

10 idx_leap = idx + size 

11 if idx+size > iterableLength: 

12 idx_leap = iterableLength 

13 print(idx_leap) 

14 yield iterable[idx:idx_leap]