/usr/local/lib/python3.9/site-packages/pip/_vendor/rich/__pycache__
a ���h� � @ s� d Z dgZddlmZmZmZmZ ddd�eee eee ee ed�dd �Z eee eeeef d �dd�Z ddd�eee ee ed �dd�ZdS )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 <https://en.wikipedia.org/wiki/Binary_prefix>`_ �decimal� )�Iterable�List�Optional�Tuple� � �� precision� separator)�size�suffixes�baser r �returnc C sb | dkrdS | |k r | d�d�S t |d�D ]\}}|| }| |k r* qHq*dj|| | |||d�S )Nr z1 byte�,z bytes� z{:,.{precision}f}{separator}{}r )� enumerate�format)r r r r r �i�suffix�unit� r �C/usr/local/lib/python3.9/site-packages/pip/_vendor/rich/filesize.py�_to_str s �r )r r r r c C s2 t |�D ] \}}|| }| || k r q*q||fS )z*Pick a suffix and base for the given size.)r )r r r r r r r r r �pick_unit_and_suffix+ s r )r r r r c C s t | dd||d�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' )ZkBZMBZGBZTBZPBZEBZZBZYBi� r )r )r r r r r r r 4 s �N)�__doc__�__all__�typingr r r r �int�strr r r r r r r �<module> s* �� ��
.
Edit
..
Edit
__init__.cpython-39.pyc
Edit
__main__.cpython-39.pyc
Edit
_cell_widths.cpython-39.pyc
Edit
_emoji_codes.cpython-39.pyc
Edit
_emoji_replace.cpython-39.pyc
Edit
_export_format.cpython-39.pyc
Edit
_extension.cpython-39.pyc
Edit
_fileno.cpython-39.pyc
Edit
_inspect.cpython-39.pyc
Edit
_log_render.cpython-39.pyc
Edit
_loop.cpython-39.pyc
Edit
_null_file.cpython-39.pyc
Edit
_palettes.cpython-39.pyc
Edit
_pick.cpython-39.pyc
Edit
_ratio.cpython-39.pyc
Edit
_spinners.cpython-39.pyc
Edit
_stack.cpython-39.pyc
Edit
_timer.cpython-39.pyc
Edit
_win32_console.cpython-39.pyc
Edit
_windows.cpython-39.pyc
Edit
_windows_renderer.cpython-39.pyc
Edit
_wrap.cpython-39.pyc
Edit
abc.cpython-39.pyc
Edit
align.cpython-39.pyc
Edit
ansi.cpython-39.pyc
Edit
bar.cpython-39.pyc
Edit
box.cpython-39.pyc
Edit
cells.cpython-39.pyc
Edit
color.cpython-39.pyc
Edit
color_triplet.cpython-39.pyc
Edit
columns.cpython-39.pyc
Edit
console.cpython-39.pyc
Edit
constrain.cpython-39.pyc
Edit
containers.cpython-39.pyc
Edit
control.cpython-39.pyc
Edit
default_styles.cpython-39.pyc
Edit
diagnose.cpython-39.pyc
Edit
emoji.cpython-39.pyc
Edit
errors.cpython-39.pyc
Edit
file_proxy.cpython-39.pyc
Edit
filesize.cpython-39.pyc
Edit
highlighter.cpython-39.pyc
Edit
json.cpython-39.pyc
Edit
jupyter.cpython-39.pyc
Edit
layout.cpython-39.pyc
Edit
live.cpython-39.pyc
Edit
live_render.cpython-39.pyc
Edit
logging.cpython-39.pyc
Edit
markup.cpython-39.pyc
Edit
measure.cpython-39.pyc
Edit
padding.cpython-39.pyc
Edit
pager.cpython-39.pyc
Edit
palette.cpython-39.pyc
Edit
panel.cpython-39.pyc
Edit
pretty.cpython-39.pyc
Edit
progress.cpython-39.pyc
Edit
progress_bar.cpython-39.pyc
Edit
prompt.cpython-39.pyc
Edit
protocol.cpython-39.pyc
Edit
region.cpython-39.pyc
Edit
repr.cpython-39.pyc
Edit
rule.cpython-39.pyc
Edit
scope.cpython-39.pyc
Edit
screen.cpython-39.pyc
Edit
segment.cpython-39.pyc
Edit
spinner.cpython-39.pyc
Edit
status.cpython-39.pyc
Edit
style.cpython-39.pyc
Edit
styled.cpython-39.pyc
Edit
syntax.cpython-39.pyc
Edit
table.cpython-39.pyc
Edit
terminal_theme.cpython-39.pyc
Edit
text.cpython-39.pyc
Edit
theme.cpython-39.pyc
Edit
themes.cpython-39.pyc
Edit
traceback.cpython-39.pyc
Edit
tree.cpython-39.pyc
Edit