def _parse(dt, fmt):
    try:
        dt = datetime.strptime(dt, fmt)
    except TypeError:
        if not isinstance(dt, datetime):
            raise FilterValidationError('Must be a datetime object')
    except ValueError as e:
        raise FilterValidationError(e)
    return dt
attempt to coerce dt into a datetime given fmt, otherwise raise
dataset/ETHPy150Open django-silk/silk/silk/request_filters.py/_parse