def _get_recently_enrolled_courses(course_enrollments):
 seconds = DashboardConfiguration.current().recent_enrollment_time_delta
 time_delta = (datetime.datetime.now(UTC) - datetime.timedelta(seconds=seconds))
 return [enrollment for enrollment in course_enrollments if (enrollment.is_active and (enrollment.created > time_delta))]

def _get_recently_enrolled_courses ( course_enrollments ) : seconds = DashboardConfiguration . current ( ) . recent_enrollment_time_delta time_delta = ( datetime . datetime . now ( UTC ) - datetime . timedelta ( seconds = seconds ) ) return [ enrollment for enrollment in course_enrollments if ( enrollment . is_active and ( enrollment . created > time_delta ) ) ]
given a list of enrollments .