def sizeof_fmt(num):
 for x in ['bytes', 'KB', 'MB', 'GB', 'TB']:
  if (num < 1024.0):
   return ('%3.1f %s' % (num, x))
  num /= 1024.0

def sizeof_fmt ( num ) : for x in [ 'bytes' , 'KB' , 'MB' , 'GB' , 'TB' ] : if ( num < 1024.0 ) : return ( '%3.1f %s' % ( num , x ) ) num /= 1024.0
return a human-readable string representation of a filesize arguments: size -- size in bytes .