def compute(self, **kwargs):
        """
        Compute the number of districts in a plan that are non-contiguous.

        @keyword plan: A L{Plan} whose set of districts should be 
            evaluated for contiguity.
        @keyword version: Optional. The version of the plan, defaults to 
            the most recent version.
        """
        if not 'plan' in kwargs:
            return

        plan = kwargs['plan']
        version = kwargs['version'] if 'version' in kwargs else plan.version
        districts = plan.get_districts_at_version(version, include_geom=False)

        calc = Contiguity()
        calc.compute(**kwargs)

        count = calc.result - len(districts)

        try:
            target = self.get_value('target')
            if target != None:
                self.result = { 'value':_('%(value)d (of %(target)s)') % {'value': count, 'target': target} }
        except:
            self.result = { 'value': count }
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/calculators.py/NonContiguous.compute/swapped operands of `-`