def wait(self) -> Optional[float]:
        """
        Returns the recommended next request time in seconds.
        """
        if self.history:
            remaining_duration = self.duration - (self.now - self.history[-1])
        else:
            remaining_duration = self.duration

        available_requests = self.num_requests - len(self.history) + 1  # type: ignore
        if available_requests <= 0:
            return None

        return remaining_duration / float(available_requests)  # type: ignore

        Returns the recommended next request time in seconds.
        
ninja/throttling.py