def avail(locale):
    '''
    Check if a locale is available.

    .. versionadded:: 2014.7.0

    CLI Example:

    .. code-block:: bash

        salt '*' locale.avail 'en_US.UTF-8'
    '''
    try:
        normalized_locale = salt.utils.locales.normalize_locale(locale)
    except __HOLE__:
        log.error('Unable to validate locale "{0}"'.format(locale))
        return False
    avail_locales = __salt__['locale.list_avail']()
    locale_exists = next((True for x in avail_locales
       if salt.utils.locales.normalize_locale(x.strip()) == normalized_locale), False)
    return locale_exists
dataset/ETHPy150Open saltstack/salt/salt/modules/localemod.py/avail