code: def parse_rake(strike, dip, rake):
      
      strike, dip = parse_strike_dip(strike, dip)
      rake, direction = split_trailing_letters(rake)
  
      if direction is not None:
          if opposite_end(strike, direction):
              rake = -rake
  
      if rake < 0:
          rake += 180
      elif rake > 180:
          rake -= 180
  
      return strike, dip, rake
docs: Parses strings of strike, dip, and rake and returns a strike, dip, and rake
      measurement following the right-hand-rule, with the "end" of the strike
      that the rake is measured from indicated by the sign of the rake (positive
      rakes correspond to the strike direction, negative rakes correspond to the
      opposite end).
  
      Accepts either quadrant-formatted or azimuth-formatted strikes.
  
      For example, this would convert a strike of "N30E", dip of "45NW", with a
      rake of "10NE" to a strike of 210, dip of 45, and rake of 170.
  
      Rake angles returned by this function will always be between 0 and 180
  
      If no directions are specified, the measuriement is assumed to follow the
      usual right-hand-rule convention.
  
      Parameters
      ----------
      strike : string
          A strike measurement. May be in azimuth or quadrant format.
      dip : string
          The dip angle and direction of a plane.
      rake : string
          The rake angle and direction that the rake is measured from.
  
      Returns
      -------
      strike, dip, rake : floats
          Measurements of strike, dip, and rake following the conventions
          outlined above.