<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fire_event(self, name, exc=None, data=None):
 """Fire event at ``name`` if it is registered """

        if self._events and name in self._events:
            self._events[name].fire(exc=exc, data=data)