#NEWLINE# def _create_in_index( self , cls , index , key , value , abstract , query = None ) : #NEWLINE# #INDENT# uri = self . _uri_for ( self . _index ( cls , index ) , query = query ) #NEWLINE# if ( cls is Node ) : #NEWLINE# #INDENT# a = cast_node ( abstract ) #NEWLINE# return self . append_post ( uri , { #NEWLINE# #INDENT# 'key' : key , #NEWLINE# 'value' : value , #NEWLINE# 'properties' : dict ( a ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( cls is Relationship ) : #NEWLINE# #INDENT# r = cast_relationship ( abstract ) #NEWLINE# return self . append_post ( uri , { #NEWLINE# #INDENT# 'key' : key , #NEWLINE# 'value' : value , #NEWLINE# 'start' : self . _uri_for ( abstract . start_node ( ) ) , #NEWLINE# 'type' : str ( abstract . type ( ) ) , #NEWLINE# 'end' : self . _uri_for ( abstract . end_node ( ) ) , #NEWLINE# 'properties' : dict ( r ) , #NEWLINE# #UNINDENT# } ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( cls )