def get_course_date_blocks(course, user):
 block_classes = (CourseEndDate, CourseStartDate, TodaysDate, VerificationDeadlineDate, VerifiedUpgradeDeadlineDate)
 blocks = (cls(course, user) for cls in block_classes)
 def block_key_fn(block):
  "\n        If the block's date is None, return the maximum datetime in order\n        to force it to the end of the list of displayed blocks.\n        "
  if (block.date is None):
   return datetime.max.replace(tzinfo=pytz.UTC)
  return block.date
 return sorted((b for b in blocks if b.is_enabled), key=block_key_fn)

def get_course_date_blocks ( course , user ) : block_classes = ( CourseEndDate , CourseStartDate , TodaysDate , VerificationDeadlineDate , VerifiedUpgradeDeadlineDate ) blocks = ( cls ( course , user ) for cls in block_classes ) def block_key_fn ( block ) : if ( block . date is None ) : return datetime . max . replace ( tzinfo = pytz . UTC ) return block . date return sorted ( ( b for b in blocks if b . is_enabled ) , key = block_key_fn )
return the list of blocks to display on the course info page .