def named_objs(objlist):
objs = []<EOL>for k, obj in objlist:<EOL><INDENT>if hasattr(k, '<STR_LIT>'):<EOL><INDENT>k = k.__name__<EOL><DEDENT>else:<EOL><INDENT>k = as_unicode(k)<EOL><DEDENT>objs.append((k, obj))<EOL><DEDENT>return objs<EOL>
Given a list of objects, returns a dictionary mapping from
string name for the object to the object itself.