code: def get_cool_off_threshold(attempt_time: datetime = None) -> datetime:
      
  
      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
docs: Get threshold for fetching access attempts from the database.