<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse_longitude(longitude, hemisphere):
 """Parse a NMEA-formatted longitude pair. Args: longitude (str):
 Longitude in DDDMM.MMMM hemisphere (str):
 East or West Returns: float: Decimal representation of longitude """

    longitude = int(longitude[:3]) + float(longitude[3:]) / 60
    if hemisphere == 'W':
        longitude = -longitude
    elif not hemisphere == 'E':
        raise ValueError('Incorrect North/South value %r' % hemisphere)
    return longitude