def even_slice(arr, size):
    """ Force array to be even by slicing off the end """
    extent = -(size % len(arr))
    if extent == 0:
        extent = None
    return arr[:extent]
dataset/ETHPy150Open kastnerkyle/SciPy2015/graphics_code/cvae/kdl_template.py/even_slice/swapped operands of `%`