def roles_to_scopes(roles):
    """Returns set of raw (not expanded) scopes for a collection of roles"""
    raw_scopes = set()

    for role in roles:
        raw_scopes.update(role.scopes)
    return raw_scopes
Returns set of raw (not expanded) scopes for a collection of roles
jupyterhub/roles.py