def from_string(locale, strict=True):
        """
        Return an instance ``Locale`` corresponding to the string
        representation of a locale.


        @param locale: a string representation of a locale, i.e., a ISO 639-3
           alpha-3 code (or alpha-2 code), optionally followed by a dash
           character ``-`` and a ISO 3166-1 alpha-2 code.

        @param strict: indicate whether the string representation of a locale
            has to be strictly compliant with RFC 4646, or whether a Java-style
            locale (character ``_`` instead of ``-``) is accepted.


        @return: an instance ``Locale``.
        """
        (language_code, country_code) = Locale.decompose_locale(locale, strict)
        return Locale(language_code, country_code)
Return an instance ``Locale`` corresponding to the string
        representation of a locale.


        @param locale: a string representation of a locale, i.e., a ISO 639-3
           alpha-3 code (or alpha-2 code), optionally followed by a dash
           character ``-`` and a ISO 3166-1 alpha-2 code.

        @param strict: indicate whether the string representation of a locale
            has to be strictly compliant with RFC 4646, or whether a Java-style
            locale (character ``_`` instead of ``-``) is accepted.


        @return: an instance ``Locale``.