def compute(self, **kwargs):
        """
        Count the number of community types which intersect a district.

        @keyword district: The L{District} to compare against the community
            map.
        @keyword community_map_id: The ID of the community map.
        @keyword version: Optional. The version of the community map. 
            Defaults to the latest version of the community map.
        """
        if 'district' in kwargs:
            district = kwargs['district']
        else:
            return

        version = None
        if 'version' in kwargs:
            version = kwargs['version']

        self.result = { 'value': _('n/a') }
        if 'community_map_id' in kwargs:
            try:
                self.result = { 'value': district.count_community_type_union(kwargs['community_map_id'], version=version) }
            except:
                pass
dataset/ETHPy150Open PublicMapping/DistrictBuilder/django/publicmapping/redistricting/calculators.py/CommunityTypeCounter.compute/original