code: def connect(host=DEFAULT_HOST, port=DEFAULT_PORT, base=DEFAULT_BASE,
              chunk_size=multipart.default_chunk_size, **defaults):
      
      # Create client instance
      client = Client(host, port, base, chunk_size, **defaults)
  
      # Query version number from daemon and validate it
      assert_version(client.version()['Version'])
  
      return client
docs: Create a new :class:`~ipfsapi.Client` instance and connect to the
      daemon to validate that its version is supported.
  
      Raises
      ------
      ~ipfsapi.exceptions.VersionMismatch
      ~ipfsapi.exceptions.ErrorResponse
      ~ipfsapi.exceptions.ConnectionError
      ~ipfsapi.exceptions.ProtocolError
      ~ipfsapi.exceptions.StatusError
      ~ipfsapi.exceptions.TimeoutError
  
  
      All parameters are identical to those passed to the constructor of the
      :class:`~ipfsapi.Client` class.
  
      Returns
      -------
          ~ipfsapi.Client