code: def deserialize_date(attr):
          
          if isinstance(attr, ET.Element):
              attr = attr.text
          if re.search(r"[^\W\d_]", attr, re.I + re.U):
              raise DeserializationError("Date must have only digits and -. Received: %s" % attr)
          # This must NOT use defaultmonth/defaultday. Using None ensure this raises an exception.
          return isodate.parse_date(attr, defaultmonth=None, defaultday=None)
docs: Deserialize ISO-8601 formatted string into Date object.
  
          :param str attr: response string to be deserialized.
          :rtype: Date
          :raises: DeserializationError if string format invalid.