def compute(self, **kwargs):
        """
        Calculate and determine if a value exceeds a threshold.

        @keyword district: A L{District} whose threshold should be 
            calculated.
        @keyword plan: A L{Plan} whose set of districts should be 
            thresholded.
        @keyword version: Optional. The version of the plan, defaults to 
            the most recent version.
        """
        districts = []

        if 'district' in kwargs:
            districts = [kwargs['district']]

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

        else:
            return

        count = 0
        for district in districts:
            val = self.get_value('value',district)
            thr = self.get_value('threshold',district)

            if val is None or thr is None:
                continue

            if float(val) > float(thr):
                count += 1

        self.result = { 'value': count }
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/calculators.py/Threshold.compute/swapped operands of `in`