def gen_instances_in_program(self, program):
        """
        Yields tracked entity instances enrolled in the given program
        """
        top_ou = self.get_top_org_unit()
        program_id = self.get_program_id(program)
        page = 1
        while True:
            response = self._request.get(
                'trackedEntityInstances',
                params={
                    'paging': 'true',
                    'page': page,
                    'links': 'false',
                    'ou': top_ou['id'],
                    'ouMode': 'DESCENDANTS',
                    'program': program_id
                })
            instances = self.entities_to_dicts(response)
            for inst in instances:
                yield inst
            if response['metaData']['pager']['pageCount'] < page:
                page += 1
            else:
                break
dataset/ETHPy150Open dimagi/commcare-hq/custom/dhis2/models.py/Dhis2Api.gen_instances_in_program/swapped operands of `<`