parameters: (filename)
docstring: Yield events from filename, reading one at a time.
docstring_summary: Yield events from filename, reading one at a time.
docstring_tokens: Yield events from filename reading one at a time .
function: def _yield_events_read(filename):
    """Yield events from filename, reading one at a time."""
    with open(filename, 'rb') as f:
      while True:
        data = f.read(header_struct.size)
        if len(data) == 0:
          return
        event_len, lencrc = header_struct.unpack(data)
        event_data = f.read(event_len)
        # Ignore the CRC.
        f.read(footer_struct.size)
        event = event_pb2.Event()
        event.ParseFromString(event_data)
        yield event
function_tokens: def _yield_events_read ( filename ) : with open ( filename , 'rb' ) as f : while True : data = f . read ( header_struct . size ) if len ( data ) == 0 : return event_len , lencrc = header_struct . unpack ( data ) event_data = f . read ( event_len ) # Ignore the CRC. f . read ( footer_struct . size ) event = event_pb2 . Event ( ) event . ParseFromString ( event_data ) yield event