parameters: (n)
return_statement: return '%.2f B/s' % (n)
docstring: >>> bytes2human(10000)
      '9.8 K/s'
      >>> bytes2human(100001221)
      '95.4 M/s'
docstring_summary: >>> bytes2human(10000)
      '9.8 K/s'
      >>> bytes2human(100001221)
      '95.4 M/s'
docstring_tokens: >>> bytes2human ( 10000 ) 9 . 8 K / s >>> bytes2human ( 100001221 ) 95 . 4 M / s
function: def bytes2human(n):
      """
      >>> bytes2human(10000)
      '9.8 K/s'
      >>> bytes2human(100001221)
      '95.4 M/s'
      """
      symbols = ('K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y')
      prefix = {}
      for i, s in enumerate(symbols):
          prefix[s] = 1 << (i + 1) * 10
      for s in reversed(symbols):
          if n >= prefix[s]:
              value = float(n) / prefix[s]
              return '%.2f %s/s' % (value, s)
      return '%.2f B/s' % (n)
function_tokens: def bytes2human ( n ) : symbols = ( 'K' , 'M' , 'G' , 'T' , 'P' , 'E' , 'Z' , 'Y' ) prefix = { } for i , s in enumerate ( symbols ) : prefix [ s ] = 1 << ( i + 1 ) * 10 for s in reversed ( symbols ) : if n >= prefix [ s ] : value = float ( n ) / prefix [ s ] return '%.2f %s/s' % ( value , s ) return '%.2f B/s' % ( n )