def METHOD_NAME(nids):
    '''
    Create a nicely formatted array of nid ranges
    '''
    ranges = []
    for k, g in groupby( enumerate(nids), lambda x: x[1]-x[0]):
        consecutive_nids = list(map(itemgetter(1), g))
        if len(consecutive_nids) == 1:
            ranges.append(str(consecutive_nids[0]))
        else:
            ranges.append("{}-{}".format(consecutive_nids[0], consecutive_nids[-1]))
    return ranges