

def getAppropriateChunksForSize(size, chunkSize):
    chunks = []
    curIx = 0
    while (curIx < size):
        top = min((curIx + chunkSize), size)
        chunks.append((curIx, top))
        curIx = top
    if ((len(chunks) > 1) and ((chunks[(- 1)][1] - chunks[(- 1)][0]) < (top / 2))):
        newLow = chunks[(- 2)][0]
        newHigh = chunks[(- 1)][1]
        chunks[(- 2):] = [(newLow, newHigh)]
    return chunks

dataset/ETHPy150Open ufora/ufora/ufora/FORA/python/CacheSemantics.py getAppropriateChunksForSize/VarMisuse@96/117 `chunkSize`->`top`