Beispiel #1
0
 def add_table(self, table):
     """ Combine this EmissionsTable object with another """
     for eic, eic_data in table.iteritems():
         if not defaultdict.__contains__(self, eic):
             defaultdict.__setitem__(self, eic, eic_data)
         else:
             for poll, value in eic_data.iteritems():
                 eic_dict = defaultdict.__getitem__(self, eic)
                 eic_dict[poll] += value
Beispiel #2
0
    def __contains__(self, key):
        """Check if a key is in the dict.

        The dict is locked for writes while doing so.
        """
        self.lock.acquire()
        result = defaultdict.__contains__(self, key)
        self.lock.release()
        return result
Beispiel #3
0
    def __contains__(self, key):
        """Check if a key is in the dict.

        The dict is locked for writes while doing so.
        """
        self.lock.acquire()
        result = defaultdict.__contains__(self, key)
        self.lock.release()
        return result
Beispiel #4
0
    def __contains__(self, key):
        """Check if a key is in the dict.

        It locks it for writes when doing so.

        """
        self.lock.acquire()
        result = defaultdict.__contains__(self, key)
        self.lock.release()
        return result
Beispiel #5
0
    def __contains__(self, key):
        """Check if a key is in the dict.

        It locks it for writes when doing so.

        """
        self.lock.acquire()
        result = defaultdict.__contains__(self, key)
        self.lock.release()
        return result
Beispiel #6
0
 def __contains__(self, key):
     return defaultdict.__contains__(self, (repr(key), key))
Beispiel #7
0
 def __contains__(self, item):
     return defaultdict.__contains__(
         self,
         self.data_source._determine_fields(item)[0])
Beispiel #8
0
 def __contains__(self, tile):
     """does not contain tiles with count 0"""
     return defaultdict.__contains__(self, tile) and self[tile] > 0
Beispiel #9
0
 def __contains__(self, key):
     return defaultdict.__contains__(self, (repr(key), key))