code: async def connect(self, url, headers={}, transports=None,
                        engineio_path='engine.io'):
          
          if self.state != 'disconnected':
              raise ValueError('Client is not in a disconnected state')
          valid_transports = ['polling', 'websocket']
          if transports is not None:
              if isinstance(transports, six.text_type):
                  transports = [transports]
              transports = [transport for transport in transports
                            if transport in valid_transports]
              if not transports:
                  raise ValueError('No valid transports provided')
          self.transports = transports or valid_transports
          self.queue = self.create_queue()
          return await getattr(self, '_connect_' + self.transports[0])(
              url, headers, engineio_path)
docs: Connect to an Engine.IO server.
  
          :param url: The URL of the Engine.IO server. It can include custom
                      query string parameters if required by the server.
          :param headers: A dictionary with custom headers to send with the
                          connection request.
          :param transports: The list of allowed transports. Valid transports
                             are ``'polling'`` and ``'websocket'``. If not
                             given, the polling transport is connected first,
                             then an upgrade to websocket is attempted.
          :param engineio_path: The endpoint where the Engine.IO server is
                                installed. The default value is appropriate for
                                most cases.
  
          Note: this method is a coroutine.
  
          Example usage::
  
              eio = engineio.Client()
              await eio.connect('http://localhost:5000')