code: def __FindSupportedVersion(protocol, server, port, path, preferredApiVersions, sslContext):
     
  
     serviceVersionDescription = __GetServiceVersionDescription(protocol,
                                                                server,
                                                                port,
                                                                path,
                                                                sslContext)
     if serviceVersionDescription is None:
        return None
  
     if not isinstance(preferredApiVersions, list):
        preferredApiVersions = [ preferredApiVersions ]
  
     for desiredVersion in preferredApiVersions:
        if __VersionIsSupported(desiredVersion, serviceVersionDescription):
           return desiredVersion
     return None
docs: Private method that returns the most preferred API version supported by the
     specified server,
  
     @param protocol: What protocol to use for the connection (e.g. https or http).
     @type  protocol: string
     @param server: Which server to connect to.
     @type  server: string
     @param port: Port
     @type  port: int
     @param path: Path
     @type  path: string
     @param preferredApiVersions: Acceptable API version(s) (e.g. vim.version.version3)
                                  If a list of versions is specified the versions should
                                  be ordered from most to least preferred.
     @type  preferredApiVersions: string or string list
     @param sslContext: SSL Context describing the various SSL options. It is only
                        supported in Python 2.7.9 or higher.
     @type  sslContext: SSL.Context