<s> '''<STR_LIT>''' <EOL> import etcd <EOL> from intuition . api . context import ContextFactory <EOL> class EtcdContext ( ContextFactory ) : <EOL> def initialize ( self , storage ) : <EOL> etcd_ip = storage [ '<STR_LIT>' ] . split ( '<STR_LIT::>' ) [ <NUM_LIT:0> ] <EOL> etcd_port = int ( storage [ '<STR_LIT>' ] . split ( '<STR_LIT::>' ) [ <NUM_LIT:1> ] ) <EOL> self . conf_id = storage [ '<STR_LIT:path>' ] [ <NUM_LIT:0> ] <EOL> self . client = etcd . Client ( host = etcd_ip , port = etcd_port ) <EOL> def load ( self ) : <EOL> context = { } <EOL> for item in self . client . get ( '<STR_LIT:/>' + self . conf_id ) : <EOL> key_1 = item . key . split ( '<STR_LIT:/>' ) [ - <NUM_LIT:1> ] <EOL> if item . dir : <EOL> context [ key_1 ] = { } <EOL> for subitem in self . client . get ( item . key ) : <EOL> context [ key_1 ] [ subitem . key . split ( '<STR_LIT:/>' ) [ - <NUM_LIT:1> ] ] = subitem . value <EOL> else : <EOL> context [ key_1 ] = item . value <EOL> return context </s>
