def set(self, key, value=None, dir=False, refresh=False, ttl=None,<EOL>prev_value=None, prev_index=None, prev_exist=None, timeout=None):
url = self.make_key_url(key)<EOL>data = self.build_args({<EOL>'<STR_LIT:value>': (six.text_type, value),<EOL>'<STR_LIT>': (bool, dir or None),<EOL>'<STR_LIT>': (bool, refresh or None),<EOL>'<STR_LIT>': (int, ttl),<EOL>'<STR_LIT>': (six.text_type, prev_value),<EOL>'<STR_LIT>': (int, prev_index),<EOL>'<STR_LIT>': (bool, prev_exist),<EOL>})<EOL>try:<EOL><INDENT>res = self.session.put(url, data=data, timeout=timeout)<EOL><DEDENT>except:<EOL><INDENT>self.erred()<EOL><DEDENT>return self.wrap_response(res)<EOL>
Requests to create an ordered node into a node by the given key.