def import_name_or_class(name):
if isinstance(name, str):<EOL><INDENT>module_name, object_name = name.rsplit('<STR_LIT:.>',<NUM_LIT:1>)<EOL>mod = __import__(module_name)<EOL>components = name.split('<STR_LIT:.>')<EOL>for comp in components[<NUM_LIT:1>:]: <EOL><INDENT>mod = getattr(mod, comp)<EOL><DEDENT>return mod<EOL><DEDENT>else:<EOL><INDENT>return name<EOL><DEDENT>
Import an obect as either a fully qualified, dotted name,