def after_n_iterations(n):
    """Return a stop criterion that stops after `n` iterations.

    Internally, the ``n_iter`` field of the climin info dictionary is
    inspected; if the value in there exceeds ``n`` by one, the criterion
    returns ``True``.

    Parameters
    ----------

    n : int
      Number of iterations to perform.


    Returns
    -------

    f : function
      Stopping criterion function.


    Examples
    --------

    >>> S.after_n_iterations(10)({'n_iter': 10})
    True
    >>> S.after_n_iterations(10)({'n_iter': 5})
    False
    >>> S.after_n_iterations(10)({'n_iter': 9})
    True
    """
    def inner(info):
        return info['n_iter'] >= n - 1
    return inner