o
    –hç  ã                   @   s   d d„ Z ddd„ZdS )c                 C   sJ   |   |¡}|dkr#|dkr#|   ||t|ƒ ¡}|d8 }|dkr#|dks|S )zn
    Returns the starting index of the nth occurrence of the substring 'needle' in the string 'haystack'.
    é    é   )ÚfindÚlen)ÚhaystackÚneedleÚnÚstart© r	   ú[/var/www/html/env_mimamsha/lib/python3.10/site-packages/stanza/utils/visualization/utils.pyÚfind_nth   s   
þr   é
   c                 C   s   |t | | ƒ S )z`
    Rounding a number to its nearest multiple of the base. round_base(49.2, base=50) = 50.
    )Úround)ÚnumÚbaser	   r	   r
   Ú
round_base   s   r   N)r   )r   r   r	   r	   r	   r
   Ú<module>   s    