

def get_version_from_href(href):
    "Returns the api version in the href.\n\n    Returns the api version in the href.\n    If no version is found, 1.0 is returned\n\n    Given: 'http://www.nova.com/123'\n    Returns: '1.0'\n\n    Given: 'http://www.nova.com/v1.1'\n    Returns: '1.1'\n\n    "
    try:
        version = re.findall('[/][v][0-9]+\\.[0-9]+[/]', href)
        if (not version):
            version = re.findall('[/][v][0-9]+\\.[0-9]+$', version)
        version = re.findall('[0-9]+\\.[0-9]', version[0])[0]
    except IndexError:
        version = '1.0'
    return version

dataset/ETHPy150Open nii-cloud/dodai-compute/nova/api/openstack/common.py get_version_from_href/VarMisuse@43/197 `href`->`version`