⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.144
Server IP:
157.245.143.252
Server:
Linux www 6.11.0-9-generic #9-Ubuntu SMP PREEMPT_DYNAMIC Mon Oct 14 13:19:59 UTC 2024 x86_64
Server Software:
nginx/1.26.0
PHP Version:
8.3.11
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
lib
/
python3
/
dist-packages
/
rich
/
__pycache__
/
View File Name :
filesize.cpython-312.pyc
"Te d Z dgZddlmZmZmZmZ ddddedee d ed ee dee defd Z dedee d edeeef fdZ dddded ee dee defdZy)a Functions for reporting filesizes. Borrowed from https://github.com/PyFilesystem/pyfilesystem2 The functions declared in this module should cover the different use cases needed to generate a string representation of a file size using several different units. Since there are many standards regarding file size units, three different functions have been implemented. See Also: * `Wikipedia: Binary prefix
`_ decimal )IterableListOptionalTuple precision separatorsizesuffixesbaser r returnc | dk( ry| |k rdj | S t |d D ] \ }}||z }| |k s n dj || z z || S )Nr z1 bytez {:,} bytes z{:,.{precision}f}{separator}{}r )format enumerate)r r r r r isuffixunits //usr/lib/python3/dist-packages/rich/filesize.py_to_strr s} qy ""4((x+ 6Qw$; , ,22 t 3 c T t | D ] \ }}||z }| ||z k s ||fS fS )z*Pick a suffix and base for the given size.)r )r r r r r r s r pick_unit_and_suffixr , sC x( 6Qw$+< ) <r c " t | dd|| S )a3 Convert a filesize in to a string (powers of 1000, SI prefixes). In this convention, ``1000 B = 1 kB``. This is typically the format used to advertise the storage capacity of USB flash drives and the like (*256 MB* meaning actually a storage capacity of more than *256 000 000 B*), or used by **Mac OS X** since v10.6 to report file sizes. Arguments: int (size): A file size. int (precision): The number of decimal places to include (default = 1). str (separator): The string to separate the value from the units (default = " "). Returns: `str`: A string containing a abbreviated file size and units. Example: >>> filesize.decimal(30000) '30.0 kB' >>> filesize.decimal(30000, precision=2, separator="") '30.00kB' )kBMBGBTBPBEBZBYBi r )r )r r r s r r r 5 s <