def __determineVersion__():
    """Check if required '_package_version_' or required '_platform_' has been nominated by callee/importer
    This is variables declared within the importing script, eg:
    _foo_version_ = '1.1.1.1.1' #where the level of points is the level of accuracy required
    _python_version_ = '2.2.2'  #where the level of points is the level of accuracy required
    _platform_ = 'rh3posix'     #where this will be a suffix on the versioned packages available, else falling back on without if none have this
    """
    global _platform, _thisdir
    _versionRequired = '_' + _thisdir + '_version_'
    _listdir = os.listdir(_dir)
    _instdirs = filter(__isVersioned__, _listdir)
    _versionSpecified = None
    try: #get specified platform, and filter packages by this
        _platform = sys._getframe(3).f_globals['_platform_'] 
        if _platform: #reduce versioned packages
            if _debug: print "Platform suffix: %s" % (_platform)
            _instdirstmp = filter(__isPlatform__,_instdirs) #filter available packages by platform
            if len(_instdirstmp) > 0: _instdirs = _instdirstmp #if platform specific packages avaliable, reduce avaliable to these
            elif _debug: print "Platform [%s] specific package not found for [%s]" % ( _platform , _thisdir )
    except: pass
    try:_versionSpecified = stripChars(sys._getframe(3).f_globals[_versionRequired].replace('.', '_'),None, _versionChars )
    except: pass    
    if _debug: print "[%s] Look for: %s  == '%s'" % ( _thisdir, _versionRequired, _versionSpecified )
    if _versionSpecified:  #found a required '_package_version_' in callee   
        _latest = _thisdir + '_' + str(_versionSpecified)
        _exists = os.path.isdir( _dir + '/' + _latest ) #exact version not found        
        if not(_exists): #try and find the closest version
            if _debug: print '[%s] Exact version not found' % (_thisdir)
            _latest, _score = __closestVersion__(_versionSpecified, _instdirs, _thisdir)
            #if _closest: _latest = _closest
            #else: raise Exception, 'Import [%s] not avaliable: could not find %s \nVersion String Example: %s (non integers are stripped)' % ( _thisdir + '_' + _versionSpecified, _score, _versionExample )
    else: #no _package_version_specified so using latest available
        if _debug: print "[%s] _%s_version_ was not specified so using latest package available" % ( _thisdir, _thisdir )
        _instdirs.sort(__versionsort__)
        if _debug: print '[%s] Available: %s' % (_thisdir, _instdirs)
        _latest = _instdirs[-1] #select last version in sorted list
    return _latest
Check if required '_package_version_' or required '_platform_' has been nominated by callee/importer
    This is variables declared within the importing script, eg:
    _foo_version_ = '1.1.1.1.1' #where the level of points is the level of accuracy required
    _python_version_ = '2.2.2'  #where the level of points is the level of accuracy required
    _platform_ = 'rh3posix'     #where this will be a suffix on the versioned packages available, else falling back on without if none have this
    
recipes/Python/285215_Package__Module_Versioning_Bootstrap_Loader_/recipe-285215.py