

def check_alignments(alignments):
    for (degree, grouped) in itertools.groupby(alignments, (lambda x: x[1])):
        planets = map((lambda x: x[0]), grouped)
        if (len(planets) > 1):
            sys.stderr.write(('BUILD FAILED' + '\n'))
            sys.stderr.write((('PLANETS ALIGNED: ' + str(planets)) + '\n'))
            sys.stderr.write((('ALIGNMENT: ' + str(int(degree))) + ' degrees\n'))
            sys.exit(1)
    sys.stdout.write('NO PLANETS ALIGNED\n')

dataset/ETHPy150Open lhartikk/AstroBuild/astro_build.py check_alignments/original