<s> '''<STR_LIT>''' <EOL> from bayesian . bbn import * <EOL> from bayesian . utils import make_key <EOL> def f_rain ( rain ) : <EOL> if rain is True : <EOL> return <NUM_LIT> <EOL> return <NUM_LIT> <EOL> def f_sprinkler ( rain , sprinkler ) : <EOL> if rain is False and sprinkler is True : <EOL> return <NUM_LIT> <EOL> if rain is False and sprinkler is False : <EOL> return <NUM_LIT> <EOL> if rain is True and sprinkler is True : <EOL> return <NUM_LIT> <EOL> if rain is True and sprinkler is False : <EOL> return <NUM_LIT> <EOL> def f_grass_wet ( sprinkler , rain , grass_wet ) : <EOL> table = dict ( ) <EOL> table [ '<STR_LIT>' ] = <NUM_LIT:0.0> <EOL> table [ '<STR_LIT>' ] = <NUM_LIT:1.0> <EOL> table [ '<STR_LIT>' ] = <NUM_LIT> <EOL> table [ '<STR_LIT>' ] = <NUM_LIT> <EOL> table [ '<STR_LIT>' ] = <NUM_LIT> <EOL> table [ '<STR_LIT>' ] = <NUM_LIT:0.1> <EOL> table [ '<STR_LIT>' ] = <NUM_LIT> <EOL> table [ '<STR_LIT>' ] = <NUM_LIT> <EOL> return table [ make_key ( sprinkler , rain , grass_wet ) ] <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> g = build_bbn ( <EOL> f_rain , <EOL> f_sprinkler , <EOL> f_grass_wet ) </s>
