<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def plural(formatter, value, name, option, format):
 """Chooses different textension for locale-specific pluralization rules. Example:: There is an item. There are 10 items. """

    # Extract the plural words from the format string.
    words = format.split('|')
    # This extension requires at least two plural words.
    if not name and len(words) == 1:
        return
    # This extension only formats numbers.
    try:
        number = decimal.Decimal(value)
    except (ValueError, decimal.InvalidOperation):
        return
    # Get the locale.
    locale = Locale.parse(option) if option else formatter.locale
    # Select word based on the plural tag index.
    index = get_plural_tag_index(number, locale)
    return formatter.format(words[index], value)