(conditions)
return multiplexer_rl
Apply the rule that matches the condition, else None
Apply the rule that matches the condition, else None
Apply the rule that matches the condition else None
def multiplexer(conditions):
    """Apply the rule that matches the condition, else None"""
    def multiplexer_rl(expr):
        for key, rule in conditions.items():
            if key(expr):
                return rule(expr)
    return multiplexer_rl
def multiplexer ( conditions ) : def multiplexer_rl ( expr ) : for key , rule in conditions . items ( ) : if key ( expr ) : return rule ( expr ) return multiplexer_rl