def in_rotation_window(self):
        """
        Determines if a certificate is available for rotation based
        on the rotation policy associated.
        :return:
        """
        now = arrow.utcnow()
        end = now + timedelta(days=self.rotation_policy.days)

        if self.not_after <= end:
            return True

        Determines if a certificate is available for rotation based
        on the rotation policy associated.
        :return:
        
lemur/certificates/models.py