#NEWLINE# def get_or_create_in_index( self , cls , index , key , value , abstract = None ) : #NEWLINE# #INDENT# ' Fetch a uniquely indexed node or relationship if one exists,\n        otherwise create a new entity and add that to the index.\n\n        :param cls: the type of indexed entity\n        :param index: index or index name\n        :param key: index entry key\n        :param value: index entry value\n        :param abstract: abstract node or relationship to create\n        :return: :class:`.Job`\n        ' #NEWLINE# query = 'uniqueness=get_or_create' #NEWLINE# if ( cls is Node ) : #NEWLINE# #INDENT# return self . _create_in_index ( cls , index , key , value , cast_node ( abstract ) , query ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( cls is Relationship ) : #NEWLINE# #INDENT# return self . _create_in_index ( cls , index , key , value , cast_relationship ( abstract ) , query ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( 'Unindexable class' )