def html(self):
        """
        Display the results in HTML format. Since the results for this
        calculator are in tuple format for sorting purposes, it's important
        to display a human readable score that explains which party the 
        plan is biased toward.

        @return: An HTML SPAN element similar to the form: "<span>Democrat 5</span>" or "<span>Balanced</span>".
        """
        if not self.result is None and self.result in 'value':
            sort = abs(self.result['value'])
            party = _('Democrat') if self.result['value'] > 0 else _('Republican')
            if sort == 0:
                return '<span>%s</span>' % _('Balanced')
            else:
                return '<span>%s&nbsp;%d</span>' % (party, sort)
        
        return '<span>%s</span>' % _('n/a')
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/calculators.py/RepresentationalFairness.html/swapped operands of `in`