#NEWLINE# def sizeof_fmt( num , suffix = 'B' ) : #NEWLINE# #INDENT# '\n    From: http://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size  # NOQA\n    Written by Fred Cirera\n    ' #NEWLINE# for unit in [ '' , 'Ki' , 'Mi' , 'Gi' , 'Ti' , 'Pi' , 'Ei' , 'Zi' ] : #NEWLINE# #INDENT# if ( abs ( num ) < 1024.0 ) : #NEWLINE# #INDENT# return ( '%3.1f%s%s' % ( suffix , unit , suffix ) ) #NEWLINE# #UNINDENT# num /= 1024.0 #NEWLINE# #UNINDENT# return ( '%.1f%s%s' % ( num , 'Yi' , suffix ) )