ifz2dZddlmZddddZ dddZdS)z$Bits and bytes related humanization.) annotations)z kBz MBz GBz TBz PBz EBz ZBz YB)z KiBz MiBz GiBz TiBz PiBz EiBz ZiBz YiBKMGTPEZY)decimalbinarygnuF%.1fvalue float | strrboolrformatstrreturnc`|rtd}n|rtd}n td}|s|rdnd}t|}t|}|dkr|sd|zS||kr|sd|zS||kr|rd |zSt|D]\}} ||d zz} || krn|||z| z z| z} | S) aPFormat 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' >>> naturalsize(10**28) '10000.0 YB' >>> naturalsize(-4096, True) '-4.0 KiB' ``` Args: value (int, float, str): Integer to convert. binary (bool): If `True`, uses binary suffixes (KiB, MiB) with base 210 instead of 103. 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. rrriiz%d Bytez%d Bytesz%dB)suffixesfloatabs enumerate) r rrr suffixbasebytes_ abs_bytesisunitrets q/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/humanize/filesize.py naturalsizer sT %% %(#)$ ,6 ,44D 5\\FF IA~~c~6!!4F""4Cv~&!!1A t   E -.2C JN)FFr) r r rr rr r r rr )__doc__ __future__rrrr rr$sl+*""""""HN    EEEEEEEr