I'm trying to understand what is going on here, specifically how curids is getting set:
for idx in xrange(0, int(math.ceil(float(len(mids))/chunk))):
curids = mids[int(idx*chunk):int((idx*chunk)+chunk)]
I'm not sure what the syntax for mids[int(idx*chunk):int((idx*chunk)+chunk)]
is trying to do.