<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_cool_off_threshold(attempt_time: datetime = None) -> datetime: """ Get threshold for fetching access attempts from the database. """


    cool_off = get_cool_off()
    if cool_off is None:
        raise TypeError('Cool off threshold can not be calculated with settings.AXES_COOLOFF_TIME set to None')

    if attempt_time is None:
        return now() - cool_off
    return attempt_time - cool_off