def lookup_type(storable_type):
if storable_type.startswith('<STR_LIT>'):<EOL><INDENT>_, module_name = storable_type.split('<STR_LIT:.>', <NUM_LIT:1>)<EOL><DEDENT>else:<EOL><INDENT>module_name = storable_type<EOL><DEDENT>names = [ _name[::-<NUM_LIT:1>] for _name in module_name[::-<NUM_LIT:1>].split('<STR_LIT:.>', <NUM_LIT:1>) ]<EOL>if names[<NUM_LIT:1>:]:<EOL><INDENT>type_name, module_name = names<EOL><DEDENT>else:<EOL><INDENT>type_name = names[<NUM_LIT:0>]<EOL>return eval(type_name)<EOL><DEDENT>try:<EOL><INDENT>module = importlib.import_module(module_name)<EOL>python_type = getattr(module, type_name)<EOL><DEDENT>except (ImportError, AttributeError):<EOL><INDENT>python_type = None<EOL><DEDENT>return python_type<EOL>
Look for the Python type that corresponds to a storable type name.