    def _lookup_share(self, user_name, owner_name, server_name):
        """Lookup the Share this URL represents

        raises 404 if not found
        """
        user = self.find_user(user_name)
        if user is None:
            raise web.HTTPError(
                404,
                f"No such share for user {user_name} on {owner_name}/{server_name}",
            )
        spawner = self._lookup_spawner(owner_name, server_name, raise_404=False)
        share = None
        if spawner:
            share = orm.Share.find(self.db, spawner, share_with=user.orm_user)
        if share is not None:
            return share
        else:
            raise web.HTTPError(
                404,
                f"No such share for user {user_name} on {owner_name}/{server_name}",
            )
Lookup the Share this URL represents

raises 404 if not found
jupyterhub/apihandlers/shares.py