def to_key(literal_or_identifier):
 if (literal_or_identifier[u'type'] == u'Identifier'):
  return literal_or_identifier[u'name']
 elif (literal_or_identifier[u'type'] == u'Literal'):
  k = literal_or_identifier[u'value']
  if isinstance(k, float):
   return unicode(float_repr(k))
  elif (u'regex' in literal_or_identifier):
   return compose_regex(k)
  elif isinstance(k, bool):
   return (u'true' if k else u'false')
  elif (k is None):
   return u'null'
  else:
   return unicode(k)

def to_key ( literal_or_identifier ) : if ( literal_or_identifier [ u'type' ] == u'Identifier' ) : return literal_or_identifier [ u'name' ] elif ( literal_or_identifier [ u'type' ] == u'Literal' ) : k = literal_or_identifier [ u'value' ] if isinstance ( k , float ) : return unicode ( float_repr ( k ) ) elif ( u'regex' in literal_or_identifier ) : return compose_regex ( k ) elif isinstance ( k , bool ) : return ( u'true' if k else u'false' ) elif ( k is None ) : return u'null' else : return unicode ( k )
returns string representation of this object .