def METHOD_NAME(
    prefix: str | None = None,
    normalize: bool = True,
    locale_getter: Callable[[], bytes] = _default_locale_getter,
) -> list[str] | None:
    """
    Get all the locales that are available on the system.
    Parameters
    ----------
    prefix : str
        If not ``None`` then return only those locales with the prefix
        provided. For example to get all English language locales (those that
        start with ``"en"``), pass ``prefix="en"``.
    normalize : bool
        Call ``locale.normalize`` on the resulting list of available locales.
        If ``True``, only locales that can be set without throwing an
        ``Exception`` are returned.
    locale_getter : callable
        The function to use to retrieve the current locales. This should return
        a string with each locale separated by a newline character.
    Returns
    -------
    locales : list of strings
        A list of locale strings that can be set with ``locale.setlocale()``.
        For example::
            locale.setlocale(locale.LC_ALL, locale_string)
    On error will return None (no locale available, e.g. Windows)
    """
    try:
        raw_locales = locale_getter()
    except subprocess.CalledProcessError:
        # Raised on (some? all?) Windows platforms because Note: "locale -a"
        #  is not defined
        return None
    try:
        # raw_locales is "\n" separated list of locales
        # it may contain non-decodable parts, so split
        # extract what we can and then rejoin.
        split_raw_locales = raw_locales.split(b"\n")
        out_locales = []
        for x in split_raw_locales:
            try:
                out_locales.append(str(x, encoding=options.display.encoding))
            except UnicodeError:
                # 'locale -a' is used to populated 'raw_locales' and on
                # Redhat 7 Linux (and maybe others) prints locale names
                # using windows-1252 encoding.  Bug only triggered by
                # a few special characters and when there is an
                # extensive list of installed locales.
                out_locales.append(str(x, encoding="windows-1252"))
    except TypeError:
        pass
    if prefix is None:
        return _valid_locales(out_locales, normalize)
    pattern = re.compile(f"{prefix}.*")
    found = pattern.findall("\n".join(out_locales))
    return _valid_locales(found, normalize)