<s> from riak import RiakClient <EOL> class Riak ( object ) : <EOL> def conn ( self ) : <EOL> """<STR_LIT>""" <EOL> client = RiakClient ( <EOL> protocol = self . conf . get ( "<STR_LIT>" ) , <EOL> http_port = self . conf . get ( "<STR_LIT:port>" ) , <EOL> host = self . conf . get ( "<STR_LIT:host>" ) ) <EOL> conn = client . bucket ( self . conf . get ( "<STR_LIT>" ) ) <EOL> conn . enable_search ( ) <EOL> return conn <EOL> def save ( self , house , data , content_type = "<STR_LIT:application/json>" ) : <EOL> """<STR_LIT>""" <EOL> return self . conn ( ) . new ( house , data = data , <EOL> content_type = content_type ) . store ( ) <EOL> def get ( self , house , callback = { } ) : <EOL> """<STR_LIT>""" <EOL> return self . conn ( ) . get ( house ) . data or callback </s>
