def get_printable_sprite(spr):
    ALPHA = '\033[01;40m'
    R = '\033[01;41m'
    G = '\033[01;42m'
    B = '\033[01;44m'
    ENDC = '\033[0m'
    palette = [ALPHA, R, G, B]
    pixel = '  '
    lines = []
    previous = None
    for i in range(8):
        line = ''
        for j in range(8):
            color = spr[i][j]
            if previous != color:
                line += palette[color]
            line += pixel
        lines.append(line)
    return lines
    output = '\n'.join(lines) + ENDC
    print(output)
dataset/ETHPy150Open gutomaia/pyNES/pynes/tests/__init__.py/get_printable_sprite/original