<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def connect(self, event_handler):
 		""" 		Connect to the websocket and authenticate it. 		When the authentication has finished, start the loop listening for messages, 		sending a ping to the server to keep the connection alive. 		:param event_handler: Every websocket event will be passed there. Takes one argument. 		:type event_handler: Function(message) 		:return: 		"""

		context = ssl.create_default_context(purpose=ssl.Purpose.CLIENT_AUTH)
		if not self.options['verify']:
			context.verify_mode = ssl.CERT_NONE

		scheme = 'wss://'
		if self.options['scheme'] != 'https':
			scheme = 'ws://'
			context = None

		url = '{scheme:s}{url:s}:{port:s}{basepath:s}/websocket'.format(
			scheme=scheme,
			url=self.options['url'],
			port=str(self.options['port']),
			basepath=self.options['basepath']
		)

		websocket = yield from websockets.connect(
			url,
			ssl=context,
		)

		yield from self._authenticate_websocket(websocket, event_handler)
		yield from self._start_loop(websocket, event_handler)