<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_m49_from_iso3(cls, iso3, use_live=True, exception=None):
 # type: (str, bool, Optional[ExceptionUpperBound]) -> Optional[int] """Get M49 from ISO3 code Args: iso3 (str):
 ISO3 code for which to get M49 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[int]: M49 code """

        countriesdata = cls.countriesdata(use_live=use_live)
        m49 = countriesdata['m49iso3'].get(iso3)
        if m49 is not None:
            return m49

        if exception is not None:
            raise exception
        return None