def get_num_msgs_for_file(file_name, summary):
    """Return the number of messages of any static code analysis for a
    particular source file.

    Parameters
    ----------
    file_name: Source file name.
    summary:   A dictionary containing per file dictionaries of static code
               analysis messages.

    Returns
    -------
    The number of messages for the source file contained in the dictionary.
    """

    num_msgs = 0
    if summary is not None:
        for message, occurrences in summary[file_name].iteritems():
            num_msgs += occurrences

    return num_msgs