<s> class NodeData ( object ) : <EOL> """<STR_LIT>""" <EOL> __slots__ = [ <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> '<STR_LIT>' , <EOL> ] <EOL> def __init__ ( self , id = None , parent = None , position = None , properties = None ) : <EOL> self . __id = None <EOL> if id is not None : <EOL> self . __id = int ( id ) <EOL> self . __parent = None <EOL> if parent is not None : <EOL> self . __parent = int ( parent ) <EOL> self . __position = None <EOL> if position is not None : <EOL> self . __position = int ( position ) <EOL> if type ( properties ) == dict : <EOL> self . __properties = properties <EOL> else : <EOL> self . __properties = { } <EOL> def __int__ ( self ) : <EOL> return self . id <EOL> def to_dict ( self ) : <EOL> """<STR_LIT>""" <EOL> return { <EOL> '<STR_LIT:id>' : self . id , <EOL> '<STR_LIT>' : self . parent , <EOL> '<STR_LIT>' : self . position , <EOL> '<STR_LIT>' : self . properties <EOL> } <EOL> def __repr__ ( self ) : <EOL> if '<STR_LIT:title>' in self . properties : <EOL> ret = "<STR_LIT>" <EOL> return ret . format ( self . id , self . properties [ '<STR_LIT:title>' ] ) <EOL> else : <EOL> ret = '<STR_LIT>' <EOL> return ret . format ( self . id , self . parent ) <EOL> @ property <EOL> def id ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __id <EOL> @ property <EOL> def parent ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __parent <EOL> @ property <EOL> def position ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __position <EOL> @ property <EOL> def properties ( self ) : <EOL> """<STR_LIT>""" <EOL> return self . __properties </s>
