def expand_share_scopes(share):
    """Get expanded scopes for a Share"""
    return expand_scopes(
        share.scopes,
        owner=share.user or share.group,
        oauth_client=share.spawner.oauth_client,
    )
Get expanded scopes for a Share
jupyterhub/scopes.py