def all_events(vars, bn, e):
if not vars:<EOL><INDENT>yield e<EOL><DEDENT>else:<EOL><INDENT>X, rest = vars[<NUM_LIT:0>], vars[<NUM_LIT:1>:]<EOL>for e1 in all_events(rest, bn, e):<EOL><INDENT>for x in bn.variable_values(X):<EOL><INDENT>yield extend(e1, X, x)<EOL><DEDENT><DEDENT><DEDENT>
Yield every way of extending e with values for all vars.