def check_if_cancelled(self, date):
result = self._check_if_cancelled_cache.get(date, None)<EOL>if result is None:<EOL><INDENT>try:<EOL><INDENT>self._prefetched_objects_cache[Event.cancellations.related.field.related_query_name()]<EOL>result = any(<EOL>((cancellation.date == date) for cancellation in self.cancellations.all())<EOL>)<EOL><DEDENT>except (AttributeError, KeyError):<EOL><INDENT>result = False<EOL>result = self.cancellations.filter(date=date).exists()<EOL><DEDENT>self._check_if_cancelled_cache[date] = result<EOL><DEDENT>if result:<EOL><INDENT>self.title_extra = _("<STR_LIT>")<EOL><DEDENT>self._last_check_if_cancelled = result<EOL>return result<EOL>
Return True if event was in cancelled state at 'date'. Also set self.title_extra to ' (CANCELLED)' if it was so.

        Warning! Results are memoized on instance level. If you need to reset "cache" of results then set ``instance._prefetched_objects_cache = {}``