parameters: (n, format="%(value).1f%(symbol)s")
return_statement: return format % dict(symbol=symbols[0], value=n)
docstring: Used by various scripts. See:
      http://goo.gl/zeJZl
  
      >>> bytes2human(10000)
      '9.8K'
      >>> bytes2human(100001221)
      '95.4M'
docstring_summary: Used by various scripts. See:
      http://goo.gl/zeJZl
docstring_tokens: Used by various scripts . See : http : // goo . gl / zeJZl
function: def bytes2human(n, format="%(value).1f%(symbol)s"):
      """Used by various scripts. See:
      http://goo.gl/zeJZl
  
      >>> bytes2human(10000)
      '9.8K'
      >>> bytes2human(100001221)
      '95.4M'
      """
      symbols = ('B', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
      prefix = {}
      for i, s in enumerate(symbols[1:]):
          prefix[s] = 1 << (i + 1) * 10
      for symbol in reversed(symbols[1:]):
          if n >= prefix[symbol]:
              value = float(n) / prefix[symbol]
              return format % locals()
      return format % dict(symbol=symbols[0], value=n)
function_tokens: def bytes2human ( n , format = "%(value).1f%(symbol)s" ) : symbols = ( 'B' , 'K' , 'M' , 'G' , 'T' , 'P' , 'E' , 'Z' , 'Y' ) prefix = { } for i , s in enumerate ( symbols [ 1 : ] ) : prefix [ s ] = 1 << ( i + 1 ) * 10 for symbol in reversed ( symbols [ 1 : ] ) : if n >= prefix [ symbol ] : value = float ( n ) / prefix [ symbol ] return format % locals ( ) return format % dict ( symbol = symbols [ 0 ] , value = n )