def gen_instances_with_equals(self, te_name, attr_name, attr_value):
        """
        Yields tracked entity instances with the given attribute set to the given value
        """
        top_ou = self.get_top_org_unit()
        te_id = self.get_te_id(te_name)
        attr_id = self.get_te_attr_id(attr_name)
        if attr_id is None:
            raise Dhis2ConfigurationError(
                'DHIS2 tracked entity attribute name "%s" unknown on host "%s"',
                attr_name, self._request.baseurl)
        page = 1
        while True:
            response = self._request.get(
                'trackedEntityInstances',
                params={
                    'paging': 'true',
                    'page': page,
                    'links': 'false',
                    'trackedEntity': te_id,
                    'ou': top_ou['id'],
                    'ouMode': 'DESCENDANTS',
                    'attribute': attr_id + ':EQ:' + attr_value
                })
            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_with_equals/swapped operands of `<`