docs: def _convert(convdef, stri):
      """Convert the string *stri* to the given conversion definition *convdef*."""
      if '%' in convdef:
          result = dt.datetime.strptime(stri, convdef)
      elif 'd' in convdef or 's' in convdef:
          regex_match = fmt_spec_regex.match(convdef)
          match_dict = regex_match.groupdict() if regex_match else {}
          align = match_dict.get('align')
          pad = match_dict.get('fill')
          if align:
              # align character is the last one
              align = align[-1]
          if align and align in '<>^' and not pad:
              pad = ' '
  
          if align == '>':
              stri = stri.lstrip(pad)
          elif align == '<':
              stri = stri.rstrip(pad)
          elif align == '^':
              stri = stri.strip(pad)
  
          if 'd' in convdef:
              result = int(stri)
          else:
              result = stri
      else:
          result = stri
      return result