<s> from threading import local <EOL> __all__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ] <EOL> _active = local ( ) <EOL> def activate ( ) : <EOL> """<STR_LIT>""" <EOL> class Collector : <EOL> used_dojo_modules = [ ] <EOL> def add ( self , module ) : <EOL> if not module in self . used_dojo_modules : <EOL> self . used_dojo_modules . append ( module ) <EOL> _active . value = Collector ( ) <EOL> def deactivate ( ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( _active , "<STR_LIT:value>" ) : <EOL> del _active . value <EOL> def get_collector ( ) : <EOL> """<STR_LIT>""" <EOL> t = getattr ( _active , "<STR_LIT:value>" , None ) <EOL> if t is not None : <EOL> try : <EOL> return t <EOL> except AttributeError : <EOL> return None <EOL> return None <EOL> def get_modules ( ) : <EOL> collector = get_collector ( ) <EOL> if collector is not None : <EOL> return collector . used_dojo_modules <EOL> return [ ] <EOL> def add_module ( module ) : <EOL> collector = get_collector ( ) <EOL> if collector is not None : <EOL> collector . add ( module ) <EOL> pass </s>
