#NEWLINE# def version( self , pretty = False , best = False ) : #NEWLINE# #INDENT# '\n        Return the version of the Linux distribution, as a string.\n\n        For details, see :func:`distro.version`.\n        ' #NEWLINE# versions = [ self . os_release_attr ( 'version_id' ) , self . lsb_release_attr ( 'release' ) , self . distro_release_attr ( 'version_id' ) , self . _parse_distro_release_content ( self . os_release_attr ( 'pretty_name' ) ) . get ( 'version_id' , '' ) , self . _parse_distro_release_content ( self . lsb_release_attr ( 'description' ) ) . get ( 'version_id' , '' ) ] #NEWLINE# version = '' #NEWLINE# if best : #NEWLINE# #INDENT# for v in versions : #NEWLINE# #INDENT# if ( ( v . count ( '.' ) > version . count ( '.' ) ) or ( version == '' ) ) : #NEWLINE# #INDENT# version = v #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# for v in versions : #NEWLINE# #INDENT# if ( v != '' ) : #NEWLINE# #INDENT# version = v #NEWLINE# break #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( pretty and version and self . codename ( ) ) : #NEWLINE# #INDENT# version = '{0} ({1})' . format ( version , self . codename ( ) ) #NEWLINE# #UNINDENT# return version