code: def parse_reply(line):
      
      if line.startswith('>'):
          line = line[1:].strip()
  
      date = user = None
  
      for pattern in COMPILED_PATTERN_MAP['reply']:
          match = pattern.match(line)
          if match:
              groups = match.groups()
              if len(groups) == 2:
                  # We're lucky and got both date and user split up.
                  date, user = groups
              else:
                  split_match = REPLY_DATE_SPLIT_REGEX.match(groups[0])
                  if split_match:
                      split_groups = split_match.groups()
                      date = split_groups[0]
                      user = split_groups[-1]
                  else:
                      # Try a simple comma split
                      split = groups[0].rsplit(',', 1)
                      if len(split) == 2:
                          date, user = split
  
      if date:
          date = date.strip()
  
      if user:
          user = user.strip()
  
      if date and user:
          return {
              'date': date.strip(),
              'from': user.strip(),
          }
docs: Parses the given reply line ("On DATE, USER wrote:") and returns a
      dictionary with the "Date" and "From" keys, or None, if couldn't parse.