def main(separator='\t'):

    # input comes from STDIN (standard input)
    data = read_mapper_output(sys.stdin, separator=separator)
    # groupby groups multiple word-count pairs by word,
    # and creates an iterator that returns consecutive keys and their group:
    #   current_word - string containing a word (the key)
    for current_word, group in groupby(data, itemgetter(0)):
        try:
            total_count = sum(int(count) for current_word, count in group)
            print "%s%s%d" % (current_word, separator, total_count)
        except ValueError:
            # count was not a number, so silently discard this item
            pass
Get instance's operational status.
dataset/ETHPy150Open coursera/dataduct/examples/resources/scripts/word_reducer.py/main--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/query.py/_GetInstOperState