def _calculate_tag_weight(weight, max_weight, distribution):
    """
    Logarithmic tag weight calculation is based on code from the
    `Tag Cloud`_ plugin for Mephisto, by Sven Fuchs.

    .. _`Tag Cloud`: http://www.artweb-design.de/projects/mephisto-plugin-tag-cloud
    """
    if distribution == LINEAR or max_weight == 1:
        return weight
    elif distribution == LOGARITHMIC:
        return math.log(weight) * math.log(max_weight) / max_weight
    raise ValueError(_('Invalid distribution algorithm specified: %s.') % distribution)
dataset/ETHPy150Open amarandon/smeuhsocial/apps/tagging/utils.py/_calculate_tag_weight/swapped operands of `/`