from typing import Optional
import calendar


def parse_month(name: str) -> Optional[int]:
    """Return the month that unambiguously matches name partially or fully.

    Return None if more than one month matches.

    Month names that are matched against are localized according to the
    currently active system locale.
    """
    comparable_name = name.lower()
    months = [
        n
        for n, m in enumerate(calendar.month_name)
        if n > 0 and m.lower().startswith(comparable_name)
    ]
    # ambiguous if more than one match; return None
    return None if len(months) != 1 else months[0]