code: def _convert_priority(p_priority):
      
      result = 0
  
      prio_map = {
          'A': 1,
          'B': 5,
          'C': 6,
          'D': 7,
          'E': 8,
          'F': 9,
      }
  
      try:
          result = prio_map[p_priority]
      except KeyError:
          if p_priority:
              # todos with no priority have priority None, and result of this
              # function will be 0. For all other letters, return 9 (lowest
              # priority in RFC 2445).
              result = 9
  
      return result
docs: Converts todo.txt priority to an iCalendar priority (RFC 2445).
  
      Priority A gets priority 1, priority B gets priority 5 and priority C-F get
      priorities 6-9. This scheme makes sure that clients that use "high",
      "medium" and "low" show the correct priority.