def _set_timeouts(self, timeouts):
(send_timeout, recv_timeout) = (None, None)<EOL>try:<EOL><INDENT>(send_timeout, recv_timeout) = timeouts<EOL><DEDENT>except TypeError:<EOL><INDENT>raise EndpointError(<EOL>'<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>if send_timeout is not None:<EOL><INDENT>self.socket.set_int_option(<EOL>nanomsg.SOL_SOCKET, nanomsg.SNDTIMEO, send_timeout)<EOL><DEDENT>if recv_timeout is not None:<EOL><INDENT>self.socket.set_int_option(<EOL>nanomsg.SOL_SOCKET, nanomsg.RCVTIMEO, recv_timeout)<EOL><DEDENT>
Set socket timeouts for send and receive respectively