def METHOD_NAME(file_to_parse):
  message_size = GetNextMessageSize(file_to_parse)
  if message_size == 0:
    return None
  try:
    event = debug_dump_pb2.Event()
    event.ParseFromString(file_to_parse.read(message_size))
  except IOError:
    print 'Invalid message in file'
    return None
  return event