Ë
    ¼Ó^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
y)é    )Ú	GeneratorÚIterable)ÚTypeVarÚVÚsequenceÚ
batch_sizeÚreturnNc              #   óŽ   K  — t        |d«      }g }| D ]'  }t        |«      |k(  r|–— g }|j                  |«       Œ) |r|–— yy­w)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       úf/var/www/ramen.bs-engineer-server.com/venv/lib/python3.12/site-packages/supervision/utils/iterables.pyÚcreate_batchesr      s^   è ø€ ô6 �Z Ó#€JØ€MØò &ˆÜˆ}Ó Ò+ØÒØˆMØ×Ñ˜WÕ%ð	&ñ
 ØÓð ùs   ‚AAÚdesired_sizeÚcontentc                 ó`   — t        d|t        | «      z
  «      }| j                  |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   -   s1   € ô4 �q˜,¬¨X«Ñ6Ó7€LØ‡O�O�W�I Ñ,Ô-Ø€Oó    c                 óœ   — t        «       }t        «       }| D ])  }||v r|j                  |«       Œ|j                  |«       Œ+ t        |«      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   sM   € ô( ‹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Š   ðß /Ý áˆCƒL€ð#Ø�q‰kð#Ø'*ð#àˆt�A‰w˜˜dÐ"Ñ#ó#ðL�4˜‘7ð ¨#ð ¸ð ¸dÀ1¹gó ð>˜d 1™gð ¨$¨q©'ô r   