<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def str2date(self, date_str):
 """ Parse date from string. If there's no template matches your string, Please go https://github.com/MacHu-GWU/rolex-project/issues submit your datetime string. I 'll update templates ASAP. This method is faster than :meth:`dateutil.parser.parse`. :param date_str: a string represent a date :type date_str: str :return: a date object **中文文档** 从string解析date。首先尝试默认模板, 如果失败了, 则尝试所有的模板。 一旦尝试成功, 就将当前成功的模板保存为默认模板。这样做在当你待解析的 字符串非常多, 且模式单一时, 只有第一次尝试耗时较多, 之后就非常快了。 该方法要快过 :meth:`dateutil.parser.parse` 方法。 """

        # try default date template
        try:
            a_datetime = datetime.strptime(
                date_str, self._default_date_template)
            return a_datetime.date()
        except:
            pass

        # try every date templates
        for template in date_template_list:
            try:
                a_datetime = datetime.strptime(date_str, template)
                self._default_date_template = template
                return a_datetime.date()
            except:
                pass

        # raise error
        raise ValueError("Unable to parse date from: %r!" % date_str)