def getTimeOfClassesRemaining(self,numClasses=<NUM_LIT:0>):
occurrences = EventOccurrence.objects.filter(<EOL>cancelled=False,<EOL>event__in=[x.event for x in self.temporaryeventregistration_set.filter(event__series__isnull=False)],<EOL>).order_by('<STR_LIT>')<EOL>if occurrences.count() > numClasses:<EOL><INDENT>return occurrences[numClasses].endTime<EOL><DEDENT>else:<EOL><INDENT>return occurrences.last().startTime<EOL><DEDENT>
For checking things like prerequisites, it's useful to check if a requirement is 'almost' met