def separate_users(node, user_ids):
    """Separates users into ones with permissions and ones without given a list.

    :param node: Node to separate based on permissions
    :param user_ids: List of ids, will also take and return User instances
    :return: list of subbed, list of removed user ids
    """
    removed = []
    subbed = []
    for user_id in user_ids:
        try:
            user = User.load(user_id)
        except __HOLE__:
            user = user_id
        if node.has_permission(user, 'read'):
            subbed.append(user_id)
        else:
            removed.append(user_id)
    return subbed, removed
dataset/ETHPy150Open CenterForOpenScience/osf.io/website/notifications/utils.py/separate_users