def get_resource_id(self, resource, name):
        """
        Returns the ID of the given resource type with the given name
        """
        response = self._request.get(resource, params={'links': 'false', 'query': name})
        if not response[resource]:
            return None
        if len(response[resource]) > 1:
            raise Dhis2ApiQueryError('Query returned multiple results')
        return response[resource][0]['id']
dataset/ETHPy150Open dimagi/commcare-hq/custom/dhis2/models.py/Dhis2Api.get_resource_id/original