def get_configured_projects(user):
 AbstractNode = apps.get_model('osf.AbstractNode')
 configured_project_ids = set()
 user_subscriptions = get_all_user_subscriptions(user)
 for subscription in user_subscriptions:
  if (subscription is None):
   continue
  node = subscription.owner
  if ((not isinstance(node, AbstractNode)) or (subscription.none.filter(id=user.id).exists() and (not node.parent_id)) or (node._id not in user.notifications_configured) or node.is_collection):
   continue
  while (node.parent_id and (not node.is_deleted)):
   node = node.parent_node
  if (not node.is_deleted):
   configured_project_ids.add(node._id)
 return list(configured_project_ids)

def get_configured_projects ( user ) : AbstractNode = apps . get_model ( 'osf.AbstractNode' ) configured_project_ids = set ( ) user_subscriptions = get_all_user_subscriptions ( user ) for subscription in user_subscriptions : if ( subscription is None ) : continue node = subscription . owner if ( ( not isinstance ( node , AbstractNode ) ) or ( subscription . none . filter ( id = user . id ) . exists ( ) and ( not node . parent_id ) ) or ( node . _id not in user . notifications_configured ) or node . is_collection ) : continue while ( node . parent_id and ( not node . is_deleted ) ) : node = node . parent_node if ( not node . is_deleted ) : configured_project_ids . add ( node . _id ) return list ( configured_project_ids )
filter all user subscriptions for ones that are on parent projects and return the project ids .