<s> '''<STR_LIT>''' <EOL> import os <EOL> import sys <EOL> from mixbox import entities <EOL> import importlib <EOL> def main ( ) : <EOL> import_mods ( "<STR_LIT:.>" ) <EOL> subs = list ( subclasses ( entities . Entity ) ) <EOL> no_namespace = [ x for x in subs if not filter_has_namespace ( x ) ] <EOL> for x in no_namespace : <EOL> print ( x ) <EOL> print ( len ( no_namespace ) ) <EOL> def filter_has_namespace ( cls ) : <EOL> if hasattr ( cls , "<STR_LIT>" ) : <EOL> return True <EOL> return False <EOL> def subclasses ( cls , _seen = None ) : <EOL> """<STR_LIT>""" <EOL> if _seen is None : <EOL> _seen = set ( ) <EOL> for sub in cls . __subclasses__ ( ) : <EOL> if sub not in _seen : <EOL> _seen . add ( sub ) <EOL> yield sub <EOL> for sub in subclasses ( sub , _seen ) : <EOL> yield sub <EOL> def import_mods ( directory ) : <EOL> """<STR_LIT>""" <EOL> for root , dirs , files in os . walk ( directory ) : <EOL> if '<STR_LIT>' in dirs : <EOL> dirs . remove ( '<STR_LIT>' ) <EOL> if '<STR_LIT>' in dirs : <EOL> dirs . remove ( '<STR_LIT>' ) <EOL> for fn in files : <EOL> filename = os . path . join ( root , fn ) <EOL> if filename . endswith ( "<STR_LIT>" ) : <EOL> modname = filename [ <NUM_LIT:2> : ] . replace ( "<STR_LIT:/>" , "<STR_LIT:.>" ) [ : - <NUM_LIT:3> ] <EOL> if modname in ( '<STR_LIT>' , ) : <EOL> continue <EOL> m = importlib . import_module ( modname ) <EOL> if __name__ == "<STR_LIT:__main__>" : <EOL> main ( ) </s>
