<s> from collections import defaultdict <EOL> register = defaultdict ( list ) <EOL> def signal ( signal , sender , ** kwargs ) : <EOL> for observer in register [ signal ] : <EOL> observer . receive ( signal , sender , ** kwargs ) <EOL> def slot ( signal , receiver ) : <EOL> register [ signal ] . append ( receiver ) <EOL> """<STR_LIT>""" </s>
