def to_key(literal_or_identifier):
if literal_or_identifier['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>return literal_or_identifier['<STR_LIT:name>']<EOL><DEDENT>elif literal_or_identifier['<STR_LIT:type>'] == '<STR_LIT>':<EOL><INDENT>k = literal_or_identifier['<STR_LIT:value>']<EOL>if isinstance(k, float):<EOL><INDENT>return unicode(float_repr(k))<EOL><DEDENT>elif '<STR_LIT>' in literal_or_identifier:<EOL><INDENT>return compose_regex(k)<EOL><DEDENT>elif isinstance(k, bool):<EOL><INDENT>return '<STR_LIT:true>' if k else '<STR_LIT:false>'<EOL><DEDENT>elif k is None:<EOL><INDENT>return '<STR_LIT:null>'<EOL><DEDENT>else:<EOL><INDENT>return unicode(k)<EOL><DEDENT><DEDENT>
returns string representation of this object