def user_queries(self, user, *params):
        """Return queries for this publication as seen by `user`."""
        try:
            get_queries = self.get_queries
        except __HOLE__:
            # statically defined queries
            if self.queries is None:
                raise NotImplementedError(
                    'Must set either queries or implement get_queries method.',
                )
            if params:
                raise NotImplementedError(
                    'Publication params not implemented on %r publication.' % (
                        self.name,
                    ),
                )
            return self.queries[:]

        if user is False:
            # no need to play with `this.user_id` or `this.user_ddp_id`.
            return get_queries(*params)

        # stash the old user details
        old_user_id = this.user_id
        old_user_ddp_id = this.user_ddp_id
        # apply the desired user details
        this.user_id = None if user is None else user.pk
        this.user_ddp_id = None if user is None else get_meteor_id(user)
        try:
            return get_queries(*params)
        finally:
            # restore the old user details
            this.user_id = old_user_id
            this.user_ddp_id = old_user_ddp_id
dataset/ETHPy150Open django-ddp/django-ddp/dddp/api.py/Publication.user_queries