#NEWLINE# def __init__( self , * nodes , **properties ) : #NEWLINE# #INDENT# n = [ ] #NEWLINE# p = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# for value in nodes : #NEWLINE# #INDENT# if isinstance ( value , string ) : #NEWLINE# #INDENT# n . append ( value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( isinstance ( value , tuple ) and ( len ( value ) == 2 ) and isinstance ( value [ 0 ] , string ) ) : #NEWLINE# #INDENT# ( t , props ) = value #NEWLINE# n . append ( t ) #NEWLINE# p . update ( props ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# n . append ( cast_node ( value ) ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# p . update ( properties ) #NEWLINE# num_args = len ( n ) #NEWLINE# if ( num_args == 0 ) : #NEWLINE# #INDENT# raise TypeError ( 'Relationships must specify at least one endpoint' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( num_args == 1 ) : #NEWLINE# #INDENT# self . __type = self . default_type ( ) #NEWLINE# n = ( n [ 0 ] , n [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( num_args == 2 ) : #NEWLINE# #INDENT# if ( ( n [ 1 ] is None ) or isinstance ( n [ 1 ] , string ) ) : #NEWLINE# #INDENT# self . __type = n [ 1 ] #NEWLINE# n = ( n [ 0 ] , n [ 0 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . __type = self . default_type ( ) #NEWLINE# n = ( n [ 0 ] , n [ 1 ] ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# if ( num_args == 3 ) : #NEWLINE# #INDENT# self . __type = n [ 1 ] #NEWLINE# n = ( n [ 0 ] , n [ 2 ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise TypeError ( 'Hyperedges not supported' ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# #UNINDENT# Entity . __init__ ( self , ( n [ 0 ] , self , n [ 1 ] ) , p ) #NEWLINE# self . __stale = set ( )