code: def get_api_version(base_url, api_version=None, timeout=10, verify=True):
      
      versions = available_api_versions(base_url, timeout, verify)
      
      newest_version = max([float(i) for i in versions])
      if api_version is None:  # Use latest
          api_version = newest_version
      else:
          if api_version not in versions:
              api_version = newest_version
      
      return api_version
docs: Get the API version specified or resolve the latest version
  
      :return api version
      :rtype: float