
    :i                     r    S SK Jr  S\\   S\S\\\   S4   4S jrS\\   S\S\S\\\   \\   4   4S	 jrg
)    )	Tokenizerlist_valuereturn.c                     U S   /n[        U SS 5       H3  u  p4XA:X  a  U/[        U SU-   S U5      Q7s  $ UR                  U5        M5     U4$ )a  Split a list of integers by a given value.

Args:
    list_: The list to split.
    value: The value to split the list by.

Returns:
    A tuple of lists of integers.

Examples:
    >>> _split_integer_list_by_value([1, 2, 3, 4, 5], 3)
    ([1, 2], [3, 4, 5])
    >>> _split_integer_list_by_value([1, 2, 3, 4, 5], 6)
    ([1, 2, 3, 4, 5],)
    >>> _split_integer_list_by_value([1, 2, 3, 4, 5], 1)
    ([1, 2, 3, 4, 5],)
    >>> _split_integer_list_by_value([1, 2, 3, 4, 5, 3, 5, 6, 7], 3)
    ([1, 2], [3, 4, 5], [3, 5, 6, 7])
r      N)	enumerate_split_integer_list_by_valueappend)r   r   resultiitems        [/home/james-whalen/.local/lib/python3.13/site-packages/mistral_common/experimental/utils.pyr
   r
      sa    ( AhZFU12Y'=Q9%A.%PQQd ( 9    	tokenizercontrol_tokenc                     UR                  U5      n[        X5      tpE[        U5      S:X  a  [        SU S35      e[        U5      S:  a  [        SU S35      eXES   4$ )zSplit a list of integers by a given control token.

Raises:
    ValueError: If the control token is not found in the list or if it is found more than once.
r   zControl token z! not found in the list of tokens.r   z, found more than once in the list of tokens.)get_control_tokenr
   len
ValueError)r   r   r   control_token_idfirstrests         r   ,_split_tokens_by_one_occurence_control_tokenr       sm     !22=A/HLE
4yA~>-8YZ[[
4y1}>-8deffq'>r   N)%mistral_common.tokens.tokenizers.baser   listinttupler
   strr    r   r   <module>r!      so    ;S	 # %S	SVBW 89!*;>
49d3i r   