def _sqlite_time_extract(lookup_type, dt):
    if dt is None:
        return None
    try:
        dt = backend_utils.typecast_time(dt)
    except (ValueError, __HOLE__):
        return None
    return getattr(dt, lookup_type)
dataset/ETHPy150Open django/django/django/db/backends/sqlite3/base.py/_sqlite_time_extract