<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def _api_version(profile=None, **connection_args):
    '''
    Sets global variables _OS_IDENTITY_API_VERSION and _TENANT_ID
    depending on API version.
    '''
    global _TENANT_ID
    global _OS_IDENTITY_API_VERSION
    try:
        if float(__salt__['keystone.api_version'](profile=profile, **connection_args).strip('v')) >= 3:
            _TENANT_ID = 'project_id'
            _OS_IDENTITY_API_VERSION = 3
    except KeyError:
        pass