def get_api_version(version_string):
 version_string = str(version_string)
 if (version_string in DEPRECATED_VERSIONS):
  LOG.warning(_LW('Version %(deprecated_version)s is deprecated, using alternative version %(alternative)s instead.'), {'deprecated_version': version_string, 'alternative': DEPRECATED_VERSIONS[version_string]})
  version_string = DEPRECATED_VERSIONS[version_string]
 if strutils.is_int_like(version_string):
  version_string = ('%s.0' % version_string)
 api_version = APIVersion(version_string)
 check_major_version(api_version)
 return api_version

def get_api_version ( version_string ) : version_string = str ( version_string ) if ( version_string in DEPRECATED_VERSIONS ) : LOG . warning ( _LW ( 'Version %(deprecated_version)s is deprecated, using alternative version %(alternative)s instead.' ) , { 'deprecated_version' : version_string , 'alternative' : DEPRECATED_VERSIONS [ version_string ] } ) version_string = DEPRECATED_VERSIONS [ version_string ] if strutils . is_int_like ( version_string ) : version_string = ( '%s.0' % version_string ) api_version = APIVersion ( version_string ) check_major_version ( api_version ) return api_version
returns checked apiversion object .