def find(
        self,
        path,
        value=None,
        attr=None,
    ):
        """Find a single resource by name or ID

        :param string path:
            The API-specific portion of the URL path
        :param string value:
            search expression
        :param string attr:
            name of attribute for secondary search
        """

        try:
            ret = self._request('GET', "/%s/%s" % (path, value)).json()
        except ks_exceptions.NotFound:
            kwargs = {attr: value}
            try:
                ret = self.find_one("/%s/detail" % (path), **kwargs)
            except ks_exceptions.NotFound:
                msg = "%s not found" % value
                raise exceptions.NotFound(msg)

        return ret
dataset/ETHPy150Open dtroyer/python-openstackclient/openstackclient/api/api.py/BaseAPI.find/original