def get_new_and_noteworthy_nodes():
 from osf.models import Node, NodeLog
 today = timezone.now()
 last_month = (today - dateutil.relativedelta.relativedelta(months=1))
 data = Node.objects.filter(date_created__gte=last_month, is_public=True, is_deleted=False, parent_nodes__isnull=True)
 nodes = []
 for node in data:
  unique_actions = NodeLog.objects.filter(node=node.pk).order_by('action').distinct('action').count()
  n = {}
  n['unique_actions'] = unique_actions
  n['contributors'] = [c._id for c in node.contributors]
  n['_id'] = node._id
  n['title'] = node.title
  nodes.append(n)
 noteworthy_nodes = sorted(nodes, key=(lambda node: node.get('unique_actions')), reverse=True)[:25]
 filtered_new_and_noteworthy = filter_nodes(noteworthy_nodes)
 return [each['_id'] for each in filtered_new_and_noteworthy]

def get_new_and_noteworthy_nodes ( ) : from osf . models import Node , NodeLog today = timezone . now ( ) last_month = ( today - dateutil . relativedelta . relativedelta ( months = 1 ) ) data = Node . objects . filter ( date_created__gte = last_month , is_public = True , is_deleted = False , parent_nodes__isnull = True ) nodes = [ ] for node in data : unique_actions = NodeLog . objects . filter ( node = node . pk ) . order_by ( 'action' ) . distinct ( 'action' ) . count ( ) n = { } n [ 'unique_actions' ] = unique_actions n [ 'contributors' ] = [ c . _id for c in node . contributors ] n [ '_id' ] = node . _id n [ 'title' ] = node . title nodes . append ( n ) noteworthy_nodes = sorted ( nodes , key = ( lambda node : node . get ( 'unique_actions' ) ) , reverse = True ) [ : 25 ] filtered_new_and_noteworthy = filter_nodes ( noteworthy_nodes ) return [ each [ '_id' ] for each in filtered_new_and_noteworthy ]
fetches new and noteworthy nodes mainly: public top-level projects with the greatest number of unique log actions .