def get_short_module_name(module_name, obj_name):
parts = module_name.split('<STR_LIT:.>')<EOL>short_name = module_name<EOL>for i in range(len(parts) - <NUM_LIT:1>, <NUM_LIT:0>, -<NUM_LIT:1>):<EOL><INDENT>short_name = '<STR_LIT:.>'.join(parts[:i])<EOL>try:<EOL><INDENT>exec('<STR_LIT>' % (short_name, obj_name))<EOL><DEDENT>except ImportError:<EOL><INDENT>short_name = '<STR_LIT:.>'.join(parts[:(i + <NUM_LIT:1>)])<EOL>break<EOL><DEDENT><DEDENT>return short_name<EOL>
Get the shortest possible module name