<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_iso2_from_iso3(cls, iso3, use_live=True, exception=None):
 # type: (str, bool, Optional[ExceptionUpperBound]) -> Optional[str] """Get ISO2 from ISO3 code Args: iso3 (str):
 ISO3 code for which to get ISO2 code use_live (bool):
 Try to get use latest data from web rather than file in package. Defaults to True. exception (Optional[ExceptionUpperBound]):
 An exception to raise if country not found. Defaults to None. Returns: Optional[str]: ISO2 code """

        countriesdata = cls.countriesdata(use_live=use_live)
        iso2 = countriesdata['iso2iso3'].get(iso3.upper())
        if iso2 is not None:
            return iso2

        if exception is not None:
            raise exception
        return None