(self, key, value)
Adds a key/value pair to the file. Note that keys DO NOT need to be
        unique. You can store multiple values under the same key and retrieve
        them using :meth:`HashReader.all`.
Adds a key/value pair to the file. Note that keys DO NOT need to be
        unique. You can store multiple values under the same key and retrieve
        them using :meth:`HashReader.all`.
Adds a key / value pair to the file . Note that keys DO NOT need to be unique . You can store multiple values under the same key and retrieve them using : meth : HashReader . all .
def add(self, key, value):
        """Adds a key/value pair to the file. Note that keys DO NOT need to be
        unique. You can store multiple values under the same key and retrieve
        them using :meth:`HashReader.all`.
        """

        assert isinstance(key, bytes_type)
        assert isinstance(value, bytes_type)

        dbfile = self.dbfile
        pos = dbfile.tell()
        dbfile.write(_lengths.pack(len(key), len(value)))
        dbfile.write(key)
        dbfile.write(value)

        # Get hash value for the key
        h = self.hashfn(key)
        # Add hash and on-disk position to appropriate bucket
        self.buckets[h & 255].append((h, pos))
def add ( self , key , value ) : assert isinstance ( key , bytes_type ) assert isinstance ( value , bytes_type ) dbfile = self . dbfile pos = dbfile . tell ( ) dbfile . write ( _lengths . pack ( len ( key ) , len ( value ) ) ) dbfile . write ( key ) dbfile . write ( value ) # Get hash value for the key h = self . hashfn ( key ) # Add hash and on-disk position to appropriate bucket self . buckets [ h & 255 ] . append ( ( h , pos ) )