def labels(filename):
    fp = open(filename)
    magicnumber, length = struct.unpack('>ii', fp.read(8))
    assert magicnumber in (2049, 2051), (magicnumber % "Not an MNIST file: %i")
    for _ in range(length):
        label, = struct.unpack('B', fp.read(1))
        yield label
dataset/ETHPy150Open pybrain/pybrain/pybrain/tools/datasets/mnist.py/labels/swapped operands of `%`