def plural(n, singular, plural, with_number=True):
    """Return the singular or plural form of a word, according to the number.

    If ``with_number`` is true (default), the return value will be the number
    followed by the word. Otherwise the word alone will be returned.
    """
    if n == 1:
        form = singular
    else:
        form = plural
    if with_number:
        return '%s %s' % (n, form)
    else:
        return form
