
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
U
    su]aa                     @   s   d Z ddddZd
ddZd	S )z$Bits and bytes related humanization.)ZkBZMBZGBZTBZPBZEBZZBZYB)ZKiBZMiBZGiBZTiBZPiBZEiBZZiBZYiBZKMGTPEZY)decimalbinarygnuF%.1fc                 C   s$  |rt d }n|rt d }nt d }|s,|r0dnd}t| }t|}|dkrX|sXd| S ||k rl|sld| S ||k r|rd	| S t|D ]d\}}	||d
  }
||
k r|s|d || |
 |	f   S ||
k r|r|d || |
 |	f   S q|r|d || |
 |	f S |d || |
 |	f S )a  Format a number of bytes like a human readable filesize (e.g. 10 kB).

    By default, decimal suffixes (kB, MB) are used.

    Non-GNU modes are compatible with jinja2's `filesizeformat` filter.

    Examples:
        ```pycon
        >>> naturalsize(3000000)
        '3.0 MB'
        >>> naturalsize(300, False, True)
        '300B'
        >>> naturalsize(3000, False, True)
        '2.9K'
        >>> naturalsize(3000, False, True, "%.3f")
        '2.930K'
        >>> naturalsize(3000, True)
        '2.9 KiB'

        ```
    Args:
        value (int, float, str): Integer to convert.
        binary (bool): If `True`, uses binary suffixes (KiB, MiB) with base
            2<sup>10</sup> instead of 10<sup>3</sup>.
        gnu (bool): If `True`, the binary argument is ignored and GNU-style
            (`ls -sh` style) prefixes are used (K, M) with the 2**10 definition.
        format (str): Custom formatter.

    Returns:
        str: Human readable representation of a filesize.
    r   r   r   i   i     z%d Bytez%d Bytesz%dB   z %sz%s)suffixesfloatabs	enumerate)valuer   r   formatsuffixbasebytesZ	abs_bytesisZunit r   B/opt/alt/python38/lib/python3.8/site-packages/humanize/filesize.pynaturalsize   s.     

r   N)FFr   )__doc__r   r   r   r   r   r   <module>   s
   