def argmax(iterable, labels=None):
    """
    Return the pair (max, amax) where max is the max of iterable and amax is the
    arg max of the iterable
    """
    iterable = enumerate(iterable) if labels is None else zip(labels, iterable)
    am, m = max(iterable, key=lambda tuple: tuple[1])
    return m, am