<s> """<STR_LIT>""" <EOL> import sys <EOL> import warnings <EOL> try : <EOL> import sysconfig <EOL> except ImportError : <EOL> import distutils . sysconfig as sysconfig <EOL> import distutils . util <EOL> def get_abbr_impl ( ) : <EOL> """<STR_LIT>""" <EOL> if hasattr ( sys , '<STR_LIT>' ) : <EOL> pyimpl = '<STR_LIT>' <EOL> elif sys . platform . startswith ( '<STR_LIT>' ) : <EOL> pyimpl = '<STR_LIT>' <EOL> elif sys . platform == '<STR_LIT>' : <EOL> pyimpl = '<STR_LIT>' <EOL> else : <EOL> pyimpl = '<STR_LIT>' <EOL> return pyimpl <EOL> def get_impl_ver ( ) : <EOL> """<STR_LIT>""" <EOL> return '<STR_LIT>' . join ( map ( str , sys . version_info [ : <NUM_LIT:2> ] ) ) <EOL> def get_platform ( ) : <EOL> """<STR_LIT>""" <EOL> return distutils . util . get_platform ( ) . replace ( '<STR_LIT:.>' , '<STR_LIT:_>' ) . replace ( '<STR_LIT:->' , '<STR_LIT:_>' ) <EOL> def get_supported ( versions = None , noarch = False ) : <EOL> """<STR_LIT>""" <EOL> supported = [ ] <EOL> if versions is None : <EOL> versions = [ ] <EOL> major = sys . version_info [ <NUM_LIT:0> ] <EOL> for minor in range ( sys . version_info [ <NUM_LIT:1> ] , - <NUM_LIT:1> , - <NUM_LIT:1> ) : <EOL> versions . append ( '<STR_LIT>' . join ( map ( str , ( major , minor ) ) ) ) <EOL> impl = get_abbr_impl ( ) <EOL> abis = [ ] <EOL> try : <EOL> soabi = sysconfig . get_config_var ( '<STR_LIT>' ) <EOL> except IOError as e : <EOL> warnings . warn ( "<STR_LIT>" . format ( e ) , RuntimeWarning ) <EOL> soabi = None <EOL> if soabi and soabi . startswith ( '<STR_LIT>' ) : <EOL> abis [ <NUM_LIT:0> : <NUM_LIT:0> ] = [ '<STR_LIT>' + soabi . split ( '<STR_LIT:->' , <NUM_LIT:1> ) [ - <NUM_LIT:1> ] ] <EOL> abi3s = set ( ) <EOL> import imp <EOL> for suffix in imp . get_suffixes ( ) : <EOL> if suffix [ <NUM_LIT:0> ] . startswith ( '<STR_LIT>' ) : <EOL> abi3s . add ( suffix [ <NUM_LIT:0> ] . split ( '<STR_LIT:.>' , <NUM_LIT:2> ) [ <NUM_LIT:1> ] ) <EOL> abis . extend ( sorted ( list ( abi3s ) ) ) <EOL> abis . append ( '<STR_LIT:none>' ) <EOL> if not noarch : <EOL> arch = get_platform ( ) <EOL> for abi in abis : <EOL> supported . append ( ( '<STR_LIT>' % ( impl , versions [ <NUM_LIT:0> ] ) , abi , arch ) ) <EOL> for i , version in enumerate ( versions ) : <EOL> supported . append ( ( '<STR_LIT>' % ( impl , version ) , '<STR_LIT:none>' , '<STR_LIT>' ) ) <EOL> if i == <NUM_LIT:0> : <EOL> supported . append ( ( '<STR_LIT>' % ( impl , versions [ <NUM_LIT:0> ] [ <NUM_LIT:0> ] ) , '<STR_LIT:none>' , '<STR_LIT>' ) ) <EOL> for i , version in enumerate ( versions ) : <EOL> supported . append ( ( '<STR_LIT>' % ( version , ) , '<STR_LIT:none>' , '<STR_LIT>' ) ) <EOL> if i == <NUM_LIT:0> : <EOL> supported . append ( ( '<STR_LIT>' % ( version [ <NUM_LIT:0> ] ) , '<STR_LIT:none>' , '<STR_LIT>' ) ) <EOL> return supported <EOL> supported_tags = get_supported ( ) <EOL> supported_tags_noarch = get_supported ( noarch = True ) </s>
