def parse_date(date_str: str, pattern=_RE_DATE) -> dt.date:
    """Parse datetime.date from YYYY-MM-DD format."""

    groups = re.match(pattern, date_str)

    return dt.date(*_date_to_tuple(groups.groupdict()))
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 ( ) ) )
Parse datetime.date from YYYY-MM-DD format.