def in_rotation_window(cls):
        """
        Determines if a certificate is available for rotation based
        on the rotation policy associated.
        :return:
        """
        return case(
            [(extract("day", cls.not_after - func.now()) <= RotationPolicy.days, True)],
            else_=False,
        )

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