docs: def _convert_pattern(p_length, p_periodunit, p_offset=None):
      """
      Converts a pattern in the form [0-9][dwmyb] and returns a date from the
      offset with the period of time added to it.
      """
      result = None
  
      p_offset = p_offset or date.today()
      p_length = int(p_length)
  
      if p_periodunit == 'd':
          result = p_offset + timedelta(p_length)
      elif p_periodunit == 'w':
          result = p_offset + timedelta(weeks=p_length)
      elif p_periodunit == 'm':
          result = _add_months(p_offset, p_length)
      elif p_periodunit == 'y':
          result = _add_months(p_offset, p_length * 12)
      elif p_periodunit == 'b':
          result = _add_business_days(p_offset, p_length)
  
      return result