def set(self, index, value=None, dir=False, ttl=None, expiration=None):
if bool(dir) is (value is not None):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>if (ttl is not None) is (expiration is None):<EOL><INDENT>raise TypeError('<STR_LIT>')<EOL><DEDENT>self.value = value<EOL>if self.dir != dir:<EOL><INDENT>self.dir = dir<EOL>self.nodes = {} if dir else None<EOL><DEDENT>self.ttl = ttl<EOL>self.expiration = expiration<EOL>self.modified_index = index<EOL>
Updates the node data.