<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet"
        integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
        integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
        crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
</html>
U
    ʗRe	                     @   s   d Z dgZddlmZmZmZmZ dddeee eee ee eddd	Z	eee eeeef d
ddZ
dddeee ee edddZdS )a  Functions for reporting filesizes. Borrowed from https://github.com/PyFilesystem/pyfilesystem2

The functions declared in this module should cover the different
usecases 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   s`   | dkrdS | |k rd | S t|dD ]\}}|| }| |k r( qFq(dj ||  | |||dS )Nr   z1 bytez
{:,} bytes   z{:,.{precision}f}{separator}{}r	   )format	enumerate)r   r   r   r
   r   isuffixunit r   /builddir/build/BUILDROOT/alt-python38-pip-22.2.1-2.el8.x86_64/opt/alt/python38/lib/python3.8/site-packages/pip/_vendor/rich/filesize.py_to_str   s    

r   )r   r   r   r   c                 C   s2   t |D ] \}}|| }| || k r q*q||fS )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 | dd||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'

    )kBMBGBTBPBEBZBYBi  r	   )r   )r   r
   r   r   r   r   r   5   s    N)__doc____all__typingr   r   r   r   intstrr   r   r   r   r   r   r   <module>   s*    