<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def handshake(self):
 """ Sets up the connection with the Serf agent and does the initial handshake. """

        if self._socket is None:
            self._socket = self._connect()
        return self.call('handshake', {"Version": 1}, expect_body=False)