    def apply_filter(cls, scopes, spawner):
        """Apply our filter, ensures all scopes have appropriate !server filter

        Any other filters will raise ValueError.
        """
        return cls._apply_filter(frozenset(scopes), spawner.user.name, spawner.name)
Apply our filter, ensures all scopes have appropriate !server filter

Any other filters will raise ValueError.
jupyterhub/orm.py