
    Zi,                        d Z ddlmZ d
dZd	S )z3Binary search function for Unicode interval tables.    )annotationsucsinttabletuple[tuple[int, int], ...]returnc                   d}t          |          dz
  }| |d         d         k     s| ||         d         k    rdS ||k    r@||z   dz  }| ||         d         k    r|dz   }n| ||         d         k     r|dz
  }ndS ||k    @dS )a  
    Binary search in interval table.

    :param ucs: Ordinal value of unicode character.
    :param table: Tuple of starting and ending ranges of ordinal values,
        in form of ``((start, end), ...)``.
    :returns: 1 if ordinal value ucs is found within lookup table, else 0.
    r         )len)r   r   lbounduboundmids        `/home/jenkins/workspace/simtester-sanitize/venv/lib/python3.11/site-packages/wcwidth/bisearch.pybisearchr      s     FZZ!^F
U1Xa[C%-"222q
F

1$sA1WFF5:a=  1WFF1 F

 1    N)r   r   r   r   r   r   )__doc__
__future__r   r    r   r   <module>r      s;    9 9 " " " " " "     r   