def batch_shuffle(index_array, batch_size):
    batch_count = int(len(index_array) / batch_size)
    # to reshape we need to be cleanly divisible by batch size
    # we stash extra items and reappend them after shuffling
    last_batch = index_array[batch_count * batch_size:]
    index_array = index_array[:batch_count * batch_size]
    index_array = index_array.reshape((batch_count, batch_size))
    np.random.shuffle(index_array)
    index_array = index_array.flatten()
    return np.append(index_array, last_batch)
Check if ``expr`` is any of ``types``.
dataset/ETHPy150Open fchollet/keras/keras/engine/training.py/batch_shuffle--crossover with--dataset/ETHPy150Open sympy/sympy/sympy/simplify/epathtools.py/EPath._hastypes