def METHOD_NAME(basename, ignore_incomplete = True):
    """
    Returns a dictionary of Message objects keyed by their ID number.
    """
    zero_time = None
    messages = {}
    for ext in [".5", ".4", ".3", ".2", ".1", ""]:
        fname = basename + ".out" + ext
        if not os.path.exists(fname):
            print(fname, "not found.")
            continue
        with open(fname) as fp:
            for line in fp:
                try:
                    [time, command] = map(lambda x: x.strip(), line.split(":hal4000:INFO:"))
                except ValueError:
                    continue
                if zero_time is None:
                    zero_time = time
                # Message handled by.
                if (command.startswith("handled by,")):
                    [m_id, module_name, m_type] = command.split(",")[1:]
                    if m_id in messages:
                        messages[m_id].handledBy(module_name)
                # Message queued.
                elif (command.startswith("queued,")):
                    [m_id, source, m_type] = command.split(",")[1:]
                    messages[m_id] = Message(m_type = m_type,
                                             source = source,
                                             time = time,
                                             zero_time = zero_time)
                # Message sent.
                elif (command.startswith("sent,")):
                    m_id = command.split(",")[1]
                    if m_id in messages:
                        messages[m_id].sent(time)
                # Message processed.
                elif (command.startswith("processed,")):
                    m_id = command.split(",")[1]
                    if m_id in messages:
                        messages[m_id].processed(time)
                elif (command.startswith("worker done,")):
                    m_id = command.split(",")[1]
                    if m_id in messages:
                        messages[m_id].incNWorkers()
    # Ignore messages that we don't have all the timing for.
    if ignore_incomplete:
        temp = {}
        for m_id in messages:
            msg = messages[m_id]
            if msg.isComplete():
                temp[m_id] = msg
        return temp
    else:
        return messages