
    *`i                         d dl mZ dee         dedeee         df         fdZdee         dededeee         ee         f         fd	Zd
S )    )	Tokenizerlist_valuereturn.c                     | d         g}t          | dd                   D ]A\  }}||k    r!|gt          | d|z   d         |          R c S |                    |           B|fS )aJ  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        u/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/mistral_common/experimental/utils.pyr
   r
      s    ( AhZFU122Y''  45==Q9%A.%PPQQQQQd9    	tokenizercontrol_tokenc                     |                     |          }t          | |          ^}}t          |          dk    rt          d| d          t          |          dk    rt          d| d          ||d         fS )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_special_tokenr
   len
ValueError)r   r   r   control_token_idfirstrests         r   ,_split_tokens_by_one_occurence_control_tokenr       s     !22=AA/7GHHLED
4yyA~~Z-ZZZ[[[
4yy1}}e-eeefff$q'>r   N)%mistral_common.tokens.tokenizers.baser   listinttupler
   strr    r   r   <module>r!      s    ; ; ; ; ; ;S	 # %S	SVBW    89!*;>
49d3i      r   