code: def parse(cls, datestr):
          
          m = DATE_RE.match(datestr)
          if m is not None:
              day = None if m.group(2) is None else int(m.group(2))
              return cls(m.group(4), m.group(3), day, m.group(1))
docs: Parse <DATE> string and make :py:class:`CalendarDate` from it.
  
          :param str datestr: String with GEDCOM date.