§
    >²¸jB  ã            	       óÎ   — d dl mZmZ d dlmZ  ed¦  «        Zdee         dedeee         ddf         fd„Zdee         d	ed
edee         fd„Z	dee         dee         fd„Z
dS )é    )Ú	GeneratorÚIterable)ÚTypeVarÚVÚsequenceÚ
batch_sizeÚreturnNc              #   ó¤   K  — t          |d¦  «        }g }| D ]0}t          |¦  «        |k    r|V — g }|                     |¦  «         Œ1|r|V — dS dS )aÒ  
    Provides a generator that yields chunks of the input sequence
    of the size specified by the `batch_size` parameter. The last
    chunk may be a smaller batch.

    Args:
        sequence: The sequence to be split into batches.
        batch_size: The expected size of a batch.

    Returns:
        A generator that yields chunks
            of `sequence` of size `batch_size`, up to the length of
            the input `sequence`.

    Examples:
        ```pycon
        >>> from supervision.utils.iterables import create_batches
        >>> list(create_batches([1, 2, 3, 4, 5], 2))
        [[1, 2], [3, 4], [5]]
        >>> list(create_batches("abcde", 3))
        [['a', 'b', 'c'], ['d', 'e']]

        ```
    é   N)ÚmaxÚlenÚappend)r   r   Úcurrent_batchÚelements       úk/root/private/project/pallet_detection_v2/.venv/lib/python3.11/site-packages/supervision/utils/iterables.pyÚcreate_batchesr      sŠ   è è € õ6 �Z Ñ#Ô#€JØ€MØð &ð &ˆÝˆ}ÑÔ Ò+Ð+ØÐÐÐØˆMØ×Ò˜WÑ%Ô%Ð%Ð%Øð ØÐÐÐÐÐðð ó    Údesired_sizeÚcontentc                 óx   — t          d|t          | ¦  «        z
  ¦  «        }|                      |g|z  ¦  «         | S )aø  
    Fill the sequence with padding elements until the sequence reaches
    the desired size.

    Args:
        sequence: The input sequence.
        desired_size: The expected size of the output list. The
            difference between this value and the actual length of `sequence`
            (if positive) dictates how many elements will be added as padding.
        content: The element to be placed at the end of the input
            `sequence` as padding.

    Returns:
        A padded version of the input `sequence` (if needed).

    Examples:
        ```pycon
        >>> from supervision.utils.iterables import fill
        >>> fill([1, 2], 4, 0)
        [1, 2, 0, 0]
        >>> fill(['a', 'b'], 3, 'c')
        ['a', 'b', 'c']

        ```
    r   )r   r   Úextend)r   r   r   Úmissing_sizes       r   Úfillr   -   s<   € õ4 �q˜,­¨X©¬Ñ6Ñ7Ô7€LØ‡O‚O�W�I Ñ,Ñ-Ô-Ð-Ø€Or   c                 óÀ   — t          ¦   «         }t          ¦   «         }| D ]1}||v r|                     |¦  «         Œ|                     |¦  «         Œ2t          |¦  «        S )aª  
    Find all duplicate elements in the input sequence.

    Args:
        sequence: The input sequence.

    Returns:
        A list of duplicate elements found in the sequence.

    Examples:
        ```pycon
        >>> from supervision.utils.iterables import find_duplicates
        >>> sorted(find_duplicates([1, 2, 3, 2, 4, 5, 1]))
        [1, 2]
        >>> find_duplicates(['a', 'b', 'c'])
        []

        ```
    )ÚsetÚaddÚlist)r   ÚseenÚ
duplicatesr   s       r   Úfind_duplicatesr    L   sf   € õ( ‰5Œ5€DÝ‘”€JØð ð ˆØ�dˆ?ˆ?Ø�NŠN˜7Ñ#Ô#Ð#Ð#à�HŠH�WÑÔÐÐÝ�
ÑÔÐr   )Úcollections.abcr   r   Útypingr   r   Úintr   r   r   r    © r   r   ú<module>r%      sé   ðØ /Ð /Ð /Ð /Ð /Ð /Ð /Ð /Ø Ð Ð Ð Ð Ð à€GˆC�L„L€ð#Ø�qŒkð#Ø'*ð#àˆt�AŒw˜˜dÐ"Ô#ð#ð #ð #ð #ðL�4˜”7ð ¨#ð ¸ð ¸dÀ1¼gð ð ð ð ð>˜d 1œgð ¨$¨q¬'ð ð ð ð ð ð r   