def assert_datasource_protocol(event):
 assert (event.type in DATASOURCE_TYPE)
 if (not (event.type == DATASOURCE_TYPE.DONE)):
  assert isinstance(event.dt, datetime)
  assert (event.dt.tzinfo == pytz.utc)

def assert_datasource_protocol ( event ) : assert ( event . type in DATASOURCE_TYPE ) if ( not ( event . type == DATASOURCE_TYPE . DONE ) ) : assert isinstance ( event . dt , datetime ) assert ( event . dt . tzinfo == pytz . utc )
assert that an event meets the protocol for datasource outputs .