<s> """<STR_LIT>""" <EOL> import inspect <EOL> import sys <EOL> from pkgutil import iter_modules <EOL> import sublime <EOL> from nimlime_core . utils . misc import format_msg <EOL> from sublime_plugin import ApplicationCommand , WindowCommand , TextCommand , EventListener <EOL> __all__ = [ ] <EOL> collision_message = format_msg ( """<STR_LIT>""" ) <EOL> def is_child_class ( child , parent ) : <EOL> return issubclass ( child , parent ) and child is not parent <EOL> def load_submodules ( ) : <EOL> """<STR_LIT>""" <EOL> for module_data in iter_modules ( __path__ , __name__ + '<STR_LIT:.>' ) : <EOL> loader , module_name , is_pkg = module_data <EOL> if not is_pkg and module_name != __name__ : <EOL> module = ( <EOL> sys . modules . get ( module_name ) or <EOL> loader . find_module ( module_name ) . load_module ( module_name ) <EOL> ) <EOL> for class_name , class_def in inspect . getmembers ( module ) : <EOL> if inspect . isclass ( class_def ) : <EOL> valid_command = ( <EOL> is_child_class ( class_def , ApplicationCommand ) or <EOL> is_child_class ( class_def , WindowCommand ) or <EOL> is_child_class ( class_def , TextCommand ) or <EOL> is_child_class ( class_def , EventListener ) <EOL> ) <EOL> if valid_command : <EOL> if class_name in __all__ : <EOL> sublime . error_message ( <EOL> collision_message . format ( <EOL> globals ( ) [ class_name ] , class_def <EOL> ) <EOL> ) <EOL> globals ( ) [ class_name ] = class_def <EOL> __all__ . append ( class_name ) <EOL> load_submodules ( ) </s>
