<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def datetime_from_iso8601(date):
 """Small helper that parses ISO-8601 date dates. datetime.datetime(2013, 4, 10, 12, 52, 39) datetime.datetime(2013, 1, 7, 12, 55, 19, 257000) """

    format = ISO8610_FORMAT
    if date.endswith("Z"):
        date = date[:-1]  # Date date is UTC
    if re.match(".*\.\d+", date):
        # Date includes microseconds
        format = ISO8610_FORMAT_MICROSECONDS
    return datetime.datetime.strptime(date, format)