def boost_nmhc(group, nmhc, med_max_mhc):
    """
    Return a fraction of boost based on total number of MHCs stimulated by peptides from the IAR.

    :param group::param pandas.core.frame.DataFrame group: The IAR under review.
    :param float nmhc: The total boost amount allotted to this criterion.
    :param tuple med_max_mhc: A tuple of median and maximum number of stimulated MHCs over candidate
          IARs.
    :returns: The percent of boost provided by this criterion.
    :rtype: float

    >>> df = pandas.DataFrame({'allele': ['A', 'A', 'B', 'A', 'B', 'A', 'B']})
    >>> boost_nmhc(df, 0.5, (3, 5))
    0.0
    >>> df = pandas.DataFrame({'allele': ['A', 'A', 'B', 'A', 'B', 'A', 'C']})
    >>> boost_nmhc(df, 1, (3, 5))
    0.17
    >>> boost_nmhc(df, 1, (2, 4))
    0.5
    >>> boost_nmhc(df, 1, (3, 3))
    1.0
    >>> boost_nmhc(df, 1, (2, 3))
    1.0
    """
    boost_thresholds = [x - med_max_mhc[0] + 1 for x in range(med_max_mhc[0], med_max_mhc[1] + 1)]
    boost_thresholds = [round(1.0 * x/sum(boost_thresholds), 2) for x in boost_thresholds]
    mhcs_stimulated = len(set(group.allele))
    return round(nmhc * sum([val for ind, val in enumerate(boost_thresholds) if
                             mhcs_stimulated - med_max_mhc[0] >= ind]), 2)