def record(self,<EOL>event_type: str,<EOL>event_data: Mapping = None,<EOL>instance: Any = None,<EOL>**kwargs) -> '<STR_LIT>':
if not self.is_setup:<EOL><INDENT>return<EOL><DEDENT>if not self.can_handle(event_type=event_type):<EOL><INDENT>return<EOL><DEDENT>event = self.get_event(event_type=event_type,<EOL>event_data=event_data,<EOL>instance=instance,<EOL>**kwargs)<EOL>self.record_event(event)<EOL>return event<EOL>
Validate and record an event.

        >>> record('event.action', object_instance)