<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_plunge_bearing(plunge, bearing):
 """ Parses strings of plunge and bearing and returns a consistent plunge and bearing measurement as floats. Plunge angles returned by this function will always be between 0 and 90. If no direction letter(s) is present, the plunge is assumed to be measured from the end specified by the bearing. If a direction letter(s) is present, the bearing will be switched to the opposite (180 degrees) end if the specified direction corresponds to the opposite end specified by the bearing. Parameters plunge : string A plunge measurement. bearing : string A bearing measurement. May be in azimuth or quadrant format. Returns ------- plunge, bearing: floats The plunge and bearing following the conventions outlined above. Examples --------- """

    bearing = parse_azimuth(bearing)
    plunge, direction = split_trailing_letters(plunge)

    if direction is not None:
        if opposite_end(bearing, direction):
            bearing +=180

    if plunge < 0:
        bearing += 180
        plunge = -plunge
    if plunge > 90:
        bearing += 180
        plunge = 180 - plunge

    if bearing > 360:
        bearing -= 360

    return plunge, bearing