def assert_datasource_protocol(event):
    """Assert that an event meets the protocol for datasource outputs."""

    assert event.type in DATASOURCE_TYPE

    # Done packets have no dt.
    if not event.type == DATASOURCE_TYPE.DONE:
        assert isinstance(event.dt, datetime)
        assert event.dt.tzinfo == pytz.utc
dataset/ETHPy150Open quantopian/zipline/zipline/gens/utils.py/assert_datasource_protocol/original