def sorting_score(start, advertised_start, announcement):
 (announcement, start, now) = sorting_dates(start, advertised_start, announcement)
 scale = 300.0
 if announcement:
  days = (now - announcement).days
  score = (- exp(((- days) / scale)))
 else:
  days = (now - start).days
  score = exp((days / scale))
 return score

def sorting_score ( start , advertised_start , announcement ) : ( announcement , start , now ) = sorting_dates ( start , advertised_start , announcement ) scale = 300.0 if announcement : days = ( now - announcement ) . days score = ( - exp ( ( ( - days ) / scale ) ) ) else : days = ( now - start ) . days score = exp ( ( days / scale ) ) return score
returns a tuple that can be used to sort the courses according to how "new" they are .