#NEWLINE# def _handles_for_property( state , p , objs ) : #NEWLINE# #INDENT# ( graph , context , base ) = state #NEWLINE# repr_value = ( lambda o : _to_raw_value ( state , o ) ) #NEWLINE# iri_to_id = ( lambda o : ( ( isinstance ( o , URIRef ) and context . shrink ( o ) ) or o ) ) #NEWLINE# term = context . get_term ( unicode ( p ) ) #NEWLINE# if term : #NEWLINE# #INDENT# p_key = term . key #NEWLINE# if ( term . container == SET_KEY ) : #NEWLINE# #INDENT# many = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# many = ( not ( len ( objs ) == 1 ) ) #NEWLINE# #UNINDENT# if term . coercion : #NEWLINE# #INDENT# if ( term . coercion == ID_KEY ) : #NEWLINE# #INDENT# repr_value = iri_to_id #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# repr_value = ( lambda o : ( ( ( unicode ( o . datatype ) == term . coercion ) and o ) or _to_raw_value ( state , o ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( not term ) and ( p == RDF . type ) ) : #NEWLINE# #INDENT# repr_value = iri_to_id #NEWLINE# #UNINDENT# p_key = context . shrink ( p ) #NEWLINE# many = ( not ( len ( objs ) == 1 ) ) #NEWLINE# #UNINDENT# if ( term and ( term . container == LIST_KEY ) ) : #NEWLINE# #INDENT# wrapped_repr = repr_value #NEWLINE# repr_value = ( lambda o : wrapped_repr ( o ) [ context . list_key ] ) #NEWLINE# #UNINDENT# return ( p_key , many , repr_value )