o
    ¯S  ã                   @   s   d Z ddddœZd
dd„Zd	S )z"Bits & Bytes related humanization.)ÚkBÚMBÚGBÚTBÚPBÚEBÚZBÚYB)ÚKiBÚMiBÚGiBÚTiBÚPiBÚEiBÚZiBÚYiBÚKMGTPEZY)ÚdecimalÚbinaryÚgnuFú%.1fc           
      C   s  |rt d }n|rt d }nt d }|s|rdnd}t| ƒ}|dkr&|s&dS ||k r0|s0d| S ||k r:|r:d	| S t|ƒD ]2\}}||d
  }	||	k r\|s\|d || |	 |f   S ||	k rp|rp|d || |	 |f   S q>|r|d || |	 |f S |d || |	 |f S )aÂ  Format a number of byteslike a human readable filesize (eg. 10 kB).  By
    default, decimal suffixes (kB, MB) are used.  Passing binary=true will use
    binary suffixes (KiB, MiB) are used and the base will be 2**10 instead of
    10**3.  If ``gnu`` is True, the binary argument is ignored and GNU-style
    (ls -sh style) prefixes are used (K, M) with the 2**10 definition.
    Non-gnu modes are compatible with jinja2's ``filesizeformat`` filter.r   r   r   i   iè  é   z1 Bytez%d Bytesz%dBé   z %sz%s)ÚsuffixesÚfloatÚ	enumerate)
Úvaluer   r   ÚformatÚsuffixÚbaseÚbytesÚiÚsÚunit© r#   úC/var/www/html/env/lib/python3.10/site-packages/humanize/filesize.pyÚnaturalsize   s$   €r%   N)FFr   )Ú__doc__r   r%   r#   r#   r#   r$   Ú<module>   s   ý