(self)
return XPath.if_(
            "@repeats = 'True'",
            within_repeat,
            within_standard,
        )
if(@repeats = 'True',
            today() >= date(last_visit_date_{form_id}) + int(@increment) + int(@starts) and
                 (@expires = '' or today() <= date(last_visit_date{form_id}) + int(@increment) + int(@expires)),
            today() >= date({anchor}) + int(@due) + int(@starts) and
                 (@expires = '' or today() <= date({anchor}) + int(@due) + int(@expires))
        )
if(
if (
def within_window(self):
        """
        if(@repeats = 'True',
            today() >= date(last_visit_date_{form_id}) + int(@increment) + int(@starts) and
                 (@expires = '' or today() <= date(last_visit_date{form_id}) + int(@increment) + int(@expires)),
            today() >= date({anchor}) + int(@due) + int(@starts) and
                 (@expires = '' or today() <= date({anchor}) + int(@due) + int(@expires))
        )
        """
        within_repeat = XPath.and_(
            XPath('today() >= ({} + {} + {})'.format(
                XPath.date(self.last_visit_date),
                XPath.int('@increment'),
                XPath.int('@starts'),
            )),
            XPath.or_(
                XPath('@expires').eq(XPath.string('')),
                XPath('today() <= ({} + {} + {})'.format(
                    XPath.date(self.last_visit_date),
                    XPath.int('@increment'),
                    XPath.int('@expires'))
                )
            )
        )
        within_standard = XPath.and_(
            XPath('today() >= ({} + {} + {})'.format(
                XPath.date(self.anchor),
                XPath.int('@due'),
                XPath.int('@starts'),
            )),
            XPath.or_(
                XPath('@expires').eq(XPath.string('')),
                XPath('today() <= ({} + {} + {})'.format(
                    XPath.date(self.anchor),
                    XPath.int('@due'),
                    XPath.int('@expires'))
                )
            )
        )
        return XPath.if_(
            "@repeats = 'True'",
            within_repeat,
            within_standard,
        )
def within_window ( self ) : within_repeat = XPath . and_ ( XPath ( 'today() >= ({} + {} + {})' . format ( XPath . date ( self . last_visit_date ) , XPath . int ( '@increment' ) , XPath . int ( '@starts' ) , ) ) , XPath . or_ ( XPath ( '@expires' ) . eq ( XPath . string ( '' ) ) , XPath ( 'today() <= ({} + {} + {})' . format ( XPath . date ( self . last_visit_date ) , XPath . int ( '@increment' ) , XPath . int ( '@expires' ) ) ) ) ) within_standard = XPath . and_ ( XPath ( 'today() >= ({} + {} + {})' . format ( XPath . date ( self . anchor ) , XPath . int ( '@due' ) , XPath . int ( '@starts' ) , ) ) , XPath . or_ ( XPath ( '@expires' ) . eq ( XPath . string ( '' ) ) , XPath ( 'today() <= ({} + {} + {})' . format ( XPath . date ( self . anchor ) , XPath . int ( '@due' ) , XPath . int ( '@expires' ) ) ) ) ) return XPath . if_ ( "@repeats = 'True'" , within_repeat , within_standard , )