def filter_parse_date(stdout, used_locale=None):
    # originally, we just passed this to strptime, but it turned out it's not exactly
    # working for some cases, such as single-digit days
    
    setlocale(LC_ALL, used_locale or USED_GIT_PARSING_LOCALE)
    
    # use regexp to sniff what we want, skipping things like TZ info
    match = re.match(r"^(?P<dow>\w+)\ {1}(?P<month>\w+)\ {1}(?P<day>\d{1,2})\ {1}(?P<hour>\d{1,2})\:{1}(?P<minute>\d{1,2})\:{1}(?P<second>\d{1,2})\ {1}(?P<year>\d+).*$", stdout, re.UNICODE)
    if not match:
        raise ValueError("Date '%s' is not matching our format, please report bug" % str(stdout))
    data = match.groupdict()
    # to be able to provide zero-padded values, non-string values must be integers 
    data.update(dict([(key, int(value)) for key, value in data.items() if key not in ["dow", "month"]]))
    date = datetime.strptime("%(dow)s %(month)s %(day)02d %(hour)02d:%(minute)02d:%(second)02d %(year)04d" % data,
        "%a %b %d %H:%M:%S %Y"
    )
    resetlocale()
    return date
Construct a datetime object from local date string returned by git show
dataset/ETHPy150Open ella/citools/citools/git.py/filter_parse_date