code: def record(self,
                 event_type: str,
                 event_data: Mapping = None,
                 instance: Any = None,
                 **kwargs) -> 'Event':
          
          if not self.is_setup:
              return
          if not self.can_handle(event_type=event_type):
              return
  
          event = self.get_event(event_type=event_type,
                                 event_data=event_data,
                                 instance=instance,
                                 **kwargs)
          self.record_event(event)
          return event
docs: Validate and record an event.
  
          >>> record('event.action', object_instance)