<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_api_version(base_url, api_version=None, timeout=10, verify=True):
 """ Get the API version specified or resolve the latest version :return api version :rtype: float """

    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