code: def validate(cls, event_info):
          
          assert 'service_key' in event_info
          assert isinstance(event_info['service_key'], six.string_types)
          assert 'event_type' in event_info
          assert event_info['event_type'] in cls.EVENT_TYPES
          if event_info['event_type'] != cls.EVENT_TYPES[0]:
              assert 'incident_key' in event_info
              assert isinstance(event_info['incident_key'], six.string_types)
          else:
              assert 'description' in event_info
  
          if 'details' in event_info:
              assert isinstance(event_info['details'], dict)
  
          if 'contexts' in event_info:
              assert isinstance(event_info['contexts'], (list, tuple,))
docs: Validate that provided event information is valid.