code: def parse_date(date_str: str, pattern=_RE_DATE) -> dt.date:
      
  
      groups = re.match(pattern, date_str)
  
      return dt.date(*_date_to_tuple(groups.groupdict()))
docs: Parse datetime.date from YYYY-MM-DD format.