def normalize_locale(value):
    value = value.replace('-', '_')
    the_locale = locale.normalize(value)

    if the_locale != value:
        # Should we return the actual locale, returned from the locale lib instead of splitting?
        try:
            return str(the_locale.split('.')[0])
        except __HOLE__:  # pragma: no cover
            pass
    return None
dataset/ETHPy150Open michaelhelmick/lassie/lassie/utils.py/normalize_locale