<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_time_event(self, time_event):
 """Add a TimeEvent. :type time_event: :class: `~opencensus.trace.time_event.TimeEvent` :param time_event: A TimeEvent object. """

        if isinstance(time_event, time_event_module.TimeEvent):
            self.time_events.append(time_event)
        else:
            raise TypeError("Type Error: received {}, but requires TimeEvent.".
                            format(type(time_event).__name__))