def get_refkey(self, obj, referent):
if isinstance(obj, dict):<EOL><INDENT>for k, v in obj.items():<EOL><INDENT>if v is referent:<EOL><INDENT>return "<STR_LIT>" % k<EOL><DEDENT><DEDENT><DEDENT>for k in dir(obj) + ['<STR_LIT>']:<EOL><INDENT>if getattr(obj, k, None) is referent:<EOL><INDENT>return "<STR_LIT>" % k<EOL><DEDENT><DEDENT>return "<STR_LIT>"<EOL>
Return the dict key or attribute name of obj which refers to
        referent.